View Javadoc

1   /*
2    * $Id$
3    * 
4    * Created on 26 Jan 2010 by Paul Harrison (paul.harrison@manchester.ac.uk)
5    *
6    * Adapted from official SOFA C implementation http://www.iausofa.org/
7    */ 
8   
9   package org.jastronomy.jsofa;
10  
11  import static java.lang.StrictMath.*; 
12  
13  /**
14   * Java implementation of Standards of Fundamental Astronomy. <a href="http://www.iausofa.org/">http://www.iausofa.org/</a>
15   * 
16   * This code has been created by hand translating the official C version.
17   * 
18   * @author Paul Harrison (paul.harrison@manchester.ac.uk) 02 Apr 2014
19   * @version JSOFA Release 20180130
20   * @since 26 Jan 2010
21   */
22  public class JSOFA {
23      /** tracked IAU SOFA release {@value}. */
24      public final static String SOFA_RELEASE = "2018-01-30";
25      
26      /** JSOFA release {@value}*/
27      public final static String JSOFA_RELEASE = "20180130b";
28  
29      /** tracked IAU SOFA revision {@value}. */
30      public final static String SOFA_REVISION = "14";
31  
32      /** Release year for this version of jauDat {@value} */
33  public final static int IYV = 2019;
34      /** The latest confirmed omission of a leap second form IERS */
35  public final static JulianDate latestConfirmedNoLeapSecondChange;
36  static {
37      JulianDate tmpval = new JulianDate(0,0);
38      try {
39          tmpval = jauCal2jd(2019,7,1); // this is from the IERS
40      } catch (JSOFAIllegalParameter e) {
41          // should not happen
42          e.printStackTrace();
43      }
44      latestConfirmedNoLeapSecondChange = tmpval;
45  }
46  static class LeapInfo {
47      final public int iyear, month;
48      final public double delat;
49      public LeapInfo(int i, int m, double t) {
50         iyear = i;
51         month = m;
52         delat = t;
53      }
54   }
55  
56  /* Dates and Delta(AT)s */
57  static final LeapInfo leapSeconds[] = {
58       new LeapInfo( 1960,  1,  1.4178180 ),
59       new LeapInfo( 1961,  1,  1.4228180 ),
60       new LeapInfo( 1961,  8,  1.3728180 ),
61       new LeapInfo( 1962,  1,  1.8458580 ),
62       new LeapInfo( 1963, 11,  1.9458580 ),
63       new LeapInfo( 1964,  1,  3.2401300 ),
64       new LeapInfo( 1964,  4,  3.3401300 ),
65       new LeapInfo( 1964,  9,  3.4401300 ),
66       new LeapInfo( 1965,  1,  3.5401300 ),
67       new LeapInfo( 1965,  3,  3.6401300 ),
68       new LeapInfo( 1965,  7,  3.7401300 ),
69       new LeapInfo( 1965,  9,  3.8401300 ),
70       new LeapInfo( 1966,  1,  4.3131700 ),
71       new LeapInfo( 1968,  2,  4.2131700 ),
72       new LeapInfo( 1972,  1, 10.0       ),
73       new LeapInfo( 1972,  7, 11.0       ),
74       new LeapInfo( 1973,  1, 12.0       ),
75       new LeapInfo( 1974,  1, 13.0       ),
76       new LeapInfo( 1975,  1, 14.0       ),
77       new LeapInfo( 1976,  1, 15.0       ),
78       new LeapInfo( 1977,  1, 16.0       ),
79       new LeapInfo( 1978,  1, 17.0       ),
80       new LeapInfo( 1979,  1, 18.0       ),
81       new LeapInfo( 1980,  1, 19.0       ),
82       new LeapInfo( 1981,  7, 20.0       ),
83       new LeapInfo( 1982,  7, 21.0       ),
84       new LeapInfo( 1983,  7, 22.0       ),
85       new LeapInfo( 1985,  7, 23.0       ),
86       new LeapInfo( 1988,  1, 24.0       ),
87       new LeapInfo( 1990,  1, 25.0       ),
88       new LeapInfo( 1991,  1, 26.0       ),
89       new LeapInfo( 1992,  7, 27.0       ),
90       new LeapInfo( 1993,  7, 28.0       ),
91       new LeapInfo( 1994,  7, 29.0       ),
92       new LeapInfo( 1996,  1, 30.0       ),
93       new LeapInfo( 1997,  7, 31.0       ),
94       new LeapInfo( 1999,  1, 32.0       ),
95       new LeapInfo( 2006,  1, 33.0       ),
96       new LeapInfo( 2009,  1, 34.0       ),
97       new LeapInfo( 2012,  7, 35.0       ),
98       new LeapInfo( 2015,  7, 36.0       ),
99       new LeapInfo( 2017,  1, 37.0       )
100   };
101 
102 
103     /** Seconds of time to radians {@value} */
104     public final static double DS2R = (7.272205216643039903848712e-5);
105 
106     /** Pi {@value}*/
107     public final static double DPI = (3.141592653589793238462643);
108 
109     /** 2Pi {@value}*/
110     public final static double D2PI = (6.283185307179586476925287);
111 
112     /** Radians to degrees {@value} */
113     public final static double DR2D = (57.29577951308232087679815);
114 
115     /** Degrees to radians {@value}*/
116     public final static double DD2R = (1.745329251994329576923691e-2);
117 
118     /** Radians to arcseconds {@value}*/
119     public final static double DR2AS = (206264.8062470963551564734);
120 
121     /** Arcseconds to radians {@value}*/
122     public final static double DAS2R = (4.848136811095359935899141e-6);
123 
124     /** Arcseconds in a full circle {@value}*/
125     public final static double TURNAS = (1296000.0);
126 
127     /** Milliarcseconds to radians {@value}*/
128     public final static double DMAS2R = (DAS2R / 1e3);
129 
130     /** Length of tropical year B1900 (days) {@value}*/
131     public final static double DTY = (365.242198781);
132 
133     /** Reference epoch (J2000.0), Julian Date {@value}*/
134     public final static double DJ00 = (2451545.0);
135 
136     /** Julian Date of Modified Julian Date zero {@value}*/
137     public final static double DJM0 = (2400000.5);
138 
139     /** Reference epoch (J2000.0), Modified Julian Date {@value} */
140     public final static double DJM00 = (51544.5);
141 
142     /** Seconds per day. {@value}*/
143     public final static double DAYSEC = (86400.0);
144 
145     /** Days per Julian year */
146     public final static double DJY = (365.25);
147 
148     /** Days per Julian century {@value} */
149     public final static double DJC = (36525.0);
150 
151     /** Days per Julian millennium {@value} */
152     public final static double DJM = (365250.0);
153     
154     /** 1977 Jan 1.0 as MJD */
155     public final static double DJM77 = (43144.0);
156 
157     /** TT minus TAI (s) */
158     public final static double TTMTAI = (32.184);
159 
160 
161     /**  Astronomical unit (m) IAU 2012 {@value} */
162     public final static double DAU = (149597870.7e3);
163     
164     /** Speed of light (m/s) {@value} */
165     public final static double CMPS = 299792458.0;
166 
167     /** Light time for 1 au (s) {@value} */
168     public final static double AULT = (DAU/CMPS);
169 
170 
171     /** Speed of light (au per day) {@value} */
172     public final static double DC = (DAYSEC / AULT);
173     
174     /** L_G = 1 - d(TT)/d(TCG) */
175     public final static double ELG = (6.969290134e-10);
176 
177     /** L_B = 1 - d(TDB)/d(TCB) at TAI 1977/1/1.0 */
178     public final static double ELB = (1.550519768e-8);
179     
180     /** Schwarzschild radius of the Sun (au) {@value}
181      = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
182     public final static double SRS = 1.97412574336e-8;
183 
184     
185     /** TDB (s) at TAI 1977/1/1.0 */
186     public final static double TDB0 = (-6.55e-5);
187 
188     private final static double TANGENT_TINY = 1e-6;
189 
190     /** dint(A) - truncate to nearest whole number towards zero (double)  */
191     private static double dint(final double A){ return ((A)<0.0?ceil(A):floor(A));}
192 
193     /** dnint(A) - round to nearest whole number (double)  */
194     private static double dnint(final double A){return ((A)<0.0?ceil((A)-0.5):floor((A)+0.5));}
195 
196     /** dsign(A,B) - magnitude of A with sign of B (double) */
197     private static double dsign(final double A, double B){return ((B)<0.0?-abs(A):abs(A));}
198 
199      
200     
201     /**
202      * Julian Date representation. The actual date is djm0+djm1, apportioned in any
203      *     convenient way between the two arguments.  For example,
204      *     JD(TT)=2450123.7 could be expressed in any of these ways,
205      *     among others:
206      *<pre>
207      *            djm0          djm1
208      *
209      *         2450123.7           0.0       (JD method)
210      *         2451545.0       -1421.3       (J2000 method)
211      *         2400000.5       50123.2       (MJD method)
212      *         2450123.5           0.2       (date &amp;time method)
213      *</pre>
214      * 
215      * The JD method is the most natural and convenient to use in
216      *     cases where the loss of several decimal digits of resolution
217      *     is acceptable.  The J2000 method is best matched to the way
218      *     the argument is handled internally and will deliver the
219      *     optimum resolution.  The MJD method and the date &amp;time methods
220      *     are both good compromises between resolution and convenience.
221      * 
222      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Jan 2010
223      * 
224      * 
225      */
226     public static class JulianDate implements Comparable<JulianDate>{
227         /**  MJD zero-point */
228         public double djm0;  
229         /** MJD offset */
230         public double djm1;
231         public JulianDate(double d1, double d2) {
232             djm0 = d1;
233             djm1 = d2;
234         }
235         /**
236          * {@inheritDoc}
237          * overrides @see java.lang.Comparable#compareTo(java.lang.Object)
238          */
239         @Override
240         public int compareTo(JulianDate o) {
241             if(this == o) return 0;
242             final Double thismjd = this.djm0 + this.djm1;
243             final Double thatmjd = o.djm0 + o.djm1;
244 
245             return thismjd.compareTo(thatmjd);
246         }
247         /**
248          * {@inheritDoc}
249          * overrides @see java.lang.Object#hashCode()
250          */
251         @Override
252         public int hashCode() {
253             final int prime = 31;
254             int result = 1;
255             long temp;
256             temp = Double.doubleToLongBits(djm0);
257             result = prime * result + (int) (temp ^ (temp >>> 32));
258             temp = Double.doubleToLongBits(djm1);
259             result = prime * result + (int) (temp ^ (temp >>> 32));
260             return result;
261         }
262         /**
263          * {@inheritDoc}
264          * overrides @see java.lang.Object#equals(java.lang.Object)
265          */
266         @Override
267         public boolean equals(Object obj) {
268             if (this == obj)
269                 return true;
270             if (obj == null)
271                 return false;
272             if (!(obj instanceof JulianDate))
273                 return false;
274             JulianDate other = (JulianDate) obj;
275             if (Double.doubleToLongBits(djm0) != Double
276                     .doubleToLongBits(other.djm0))
277                 return false;
278             if (Double.doubleToLongBits(djm1) != Double
279                     .doubleToLongBits(other.djm1))
280                 return false;
281             return true;
282         }
283         /**
284          * {@inheritDoc}
285          * overrides @see java.lang.Object#toString()
286          */
287         @Override
288         public String toString() {
289             return String.format("MJD=%.9f", djm0 + djm1  - DJM0);
290         }
291     }
292  
293     /**
294     * Decompose radians into degrees, arcminutes, arcseconds, fraction.
295     *  
296     *
297     *  <p>This function is derived from the International Astronomical Union's
298     *  SOFA (Standards Of Fundamental Astronomy) software collection.
299     *
300     *  <p>Status:  vector/matrix support function.
301     *  
302     *
303     *
304     *<p>Called:<ul>
305     *     <li>{@link #jauD2tf}      decompose days to hms
306     *</ul>
307     * <p>Notes:
308     *<ol>
309     *  <li> The argument ndp is interpreted as follows:
310     *
311     * <pre>
312     *     ndp         resolution
313     *      :      ...0000 00 00
314     *     -7         1000 00 00
315     *     -6          100 00 00
316     *     -5           10 00 00
317     *     -4            1 00 00
318     *     -3            0 10 00
319     *     -2            0 01 00
320     *     -1            0 00 10
321     *      0            0 00 01
322     *      1            0 00 00.1
323     *      2            0 00 00.01
324     *      3            0 00 00.001
325     *      :            0 00 00.000...
326     *</pre>
327     *  <li> The largest positive useful value for ndp is determined by the
328     *     size of angle, the format of doubles on the target platform, and
329     *     the risk of overflowing idmsf[3].  On a typical platform, for
330     *     angle up to 2pi, the available floating-point precision might
331     *     correspond to ndp=12.  However, the practical limit is typically
332     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
333     *     only 16 bits.
334     *
335     *  <li> The absolute value of angle may exceed 2pi.  In cases where it
336     *     does not, it is up to the caller to test for and handle the
337     *     case where angle is very nearly 2pi and rounds up to 360 degrees,
338     *     by testing for idmsf[0]=360 and setting idmsf[0-3] to zero.
339     *</ol>
340     *@version 2008 May 27
341     *
342     *  @since Release 20101201
343     *
344     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
345     * <!-- Given: -->
346     *    @param ndp     int     resolution (Note 1)
347     *    @param angle   double  angle in radians
348     *    @param idmsf   int[4] <u>returned</u> degrees, arcminutes, arcseconds, fraction
349     * <!-- Returned: -->
350     *    @return sign    char    '+' or '-'
351     */
352     public static char jauA2af(final int ndp, final double angle,  int idmsf[] ){
353         /* Hours to degrees * radians to turns */
354         final double F = 15.0 / D2PI;
355 
356 
357      /* Scale then use days to h,m,s function. */
358         char retval = jauD2tf(ndp, angle*F, idmsf);
359 
360         return retval;
361 
362         
363     }
364     
365 
366     
367     /**
368     *  Decompose radians into hours, minutes, seconds, fraction.
369     *
370     *<p>This function is derived from the International Astronomical Union's
371     *  SOFA (Standards Of Fundamental Astronomy) software collection.
372     *
373     *<p>Status:  vector/matrix support function.
374     *
375     *<!-- Given: -->
376     *     @param ndp      int      resolution (Note 1)
377     *     @param angle    double   angle in radians
378     *
379     *<!-- Returned: -->
380     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
381     *     @return sign     char      <u>returned</u> '+' or '-'
382     *
383     *<p>Called:<ul>
384     *     <li>{@link #jauD2tf} decompose days to hms
385     * </ul>
386     * <p>Notes:
387     * <ol>
388     *
389     * <li> The argument ndp is interpreted as follows:
390     * <pre>
391     *     ndp         resolution
392     *      :      ...0000 00 00
393     *     -7         1000 00 00
394     *     -6          100 00 00
395     *     -5           10 00 00
396     *     -4            1 00 00
397     *     -3            0 10 00
398     *     -2            0 01 00
399     *     -1            0 00 10
400     *      0            0 00 01
401     *      1            0 00 00.1
402     *      2            0 00 00.01
403     *      3            0 00 00.001
404     *      :            0 00 00.000...
405     *</pre>
406     * <li> The largest positive useful value for ndp is determined by the
407     *     size of angle, the format of doubles on the target platform, and
408     *     the risk of overflowing ihmsf[3].  On a typical platform, for
409     *     angle up to 2pi, the available floating-point precision might
410     *     correspond to ndp=12.  However, the practical limit is typically
411     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
412     *     only 16 bits.
413     *
414     * <li> The absolute value of angle may exceed 2pi.  In cases where it
415     *     does not, it is up to the caller to test for and handle the
416     *     case where angle is very nearly 2pi and rounds up to 24 hours,
417     *     by testing for ihmsf[0]=24 and setting ihmsf(0-3) to zero.
418     *</ol>
419     *  @version 2008 May 11
420     *
421     *  @since Release 20101201
422     *
423     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
424     */
425     public static char jauA2tf(final int ndp, final double angle, int ihmsf[])
426     {
427     /* Scale then use days to h,m,s function. */
428      return  jauD2tf(ndp, angle/D2PI, ihmsf);
429 
430      }
431     
432 
433     /**
434     *  Normalize angle into the range {@code 0 <= a < 2pi}.
435     *
436     *<p>This function is derived from the International Astronomical Union's
437     *  SOFA (Standards Of Fundamental Astronomy) software collection.
438     *
439     *<p>Status:  vector/matrix support function.
440     *
441     *<!-- Given: -->
442     *     @param a         double      angle (radians)
443     *
444     * <!-- Returned (function value): -->
445     *  @return double     angle in range 0-2pi
446     *
447     *@version 2008 May 16
448     *
449     *  @since Release 20101201
450     *
451     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
452     */
453     public static double jauAnp(final double a)
454    {
455        double w;
456 
457 
458        w = fmod(a, D2PI);
459        if (w < 0) w += D2PI;
460 
461        return w;
462 
463     }
464     
465 
466     /**
467     *  Normalize angle into the range  {@code -pi <= a < +pi}.
468     *
469     *<p>This function is derived from the International Astronomical Union's
470     *  SOFA (Standards Of Fundamental Astronomy) software collection.
471     *
472     *<p>Status:  vector/matrix support function.
473     *
474     *<!-- Given: -->
475     *     @param a         double      angle (radians)
476     *
477     * <!-- Returned (function value): -->
478     *  @return double     angle in range +/-pi
479     *
480     *@version 2008 May 16
481     *
482     *  @since Release 20101201
483     *
484     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
485     */
486     public static double jauAnpm(final double a)
487     {
488        double w;
489 
490 
491        w = fmod(a, D2PI);
492        if (abs(w) >= DPI) w -= dsign(D2PI, a);
493 
494        return w;
495 
496         }
497     /**
498      * Frame bias components of IAU 2000 precession-nutation models.
499      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 2 Feb 2010
500      * 
501      * @since AIDA Stage 1
502      */
503     public static class FrameBias {
504         /** longitude  corrections */
505         public double dpsibi;
506         /**obliquity corrections */
507         public double depsbi;
508         /** the ICRS RA of the J2000.0 mean equinox */
509         public double dra;
510     };
511 
512     /**
513     *  Frame bias components of IAU 2000 precession-nutation models (part
514     *  of MHB2000 with additions).
515     *
516     *<p>This function is derived from the International Astronomical Union's
517     *  SOFA (Standards Of Fundamental Astronomy) software collection.
518     *
519     *<p>Status:  canonical model.
520     *
521     *<!-- Returned: -->
522     *     @return dpsibi,depsbi   double    <u>returned</u> longitude and obliquity corrections
523     *             dra             double    <u>returned</u> the ICRS RA of the J2000.0 mean equinox
524     *
525     * <p>Notes:
526     * <ol>
527     *
528     * <li> The frame bias corrections in longitude and obliquity (radians)
529     *     are required in order to correct for the offset between the GCRS
530     *     pole and the mean J2000.0 pole.  They define, with respect to the
531     *     GCRS frame, a J2000.0 mean pole that is consistent with the rest
532     *     of the IAU 2000A precession-nutation model.
533     *
534     * <li> In addition to the displacement of the pole, the complete
535     *     description of the frame bias requires also an offset in right
536     *     ascension.  This is not part of the IAU 2000A model, and is from
537     *     Chapront et al. (2002).  It is returned in radians.
538     *
539     * <li> This is a supplemented implementation of one aspect of the IAU
540     *     2000A nutation model, formally adopted by the IAU General
541     *     Assembly in 2000, namely MHB2000 (Mathews et al. 2002).
542     *</ol>
543     *<p>References:
544     *
545     *     Chapront, J., Chapront-Touze, M. &amp;Francou, G., Astron.
546     *     Astrophys., 387, 700, 2002.
547     *
548     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
549     *     and precession   New nutation series for nonrigid Earth and
550     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
551     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
552     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
553     *
554     *@version 2009 December 17
555     *
556     *  @since Release 20101201
557     *
558     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
559     */
560     public static FrameBias jauBi00()
561    {
562     /* The frame bias corrections in longitude and obliquity */
563        final double DPBIAS = -0.041775  * DAS2R,
564                     DEBIAS = -0.0068192 * DAS2R;
565 
566     /* The ICRS RA of the J2000.0 equinox (Chapront et al., 2002) */
567        final double DRA0 = -0.0146 * DAS2R;
568 
569 
570     /* Return the results (which are fixed). */
571        FrameBias retval = new FrameBias();
572        retval.dpsibi = DPBIAS;
573        retval.depsbi = DEBIAS;
574        retval.dra = DRA0;
575 
576        return retval;
577 
578         }
579     
580 
581     /**
582     *  Frame bias and precession, IAU 2000.
583     *
584     *<p>This function is derived from the International Astronomical Union's
585     *  SOFA (Standards Of Fundamental Astronomy) software collection.
586     *
587     *<p>Status:  canonical model.
588     *
589     *<!-- Given: -->
590     *      @param date1  double          TT as a 2-part Julian Date (Note 1)
591     *      @param date2   double          TT as a 2-part Julian Date (Note 1)
592     *
593     *<!-- Returned: -->
594     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
595     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
596     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
597     *
598     * <p>Notes:
599     * <ol>
600     *
601     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
602     *     convenient way between the two arguments.  For example,
603     *     JD(TT)=2450123.7 could be expressed in any of these ways,
604     *     among others:
605     *<pre>
606     *             date1         date2
607     *
608     *         2450123.7           0.0       (JD method)
609     *         2451545.0       -1421.3       (J2000 method)
610     *         2400000.5       50123.2       (MJD method)
611     *         2450123.5           0.2       (date &amp;time method)
612     *</pre>
613     *     The JD method is the most natural and convenient to use in
614     *     cases where the loss of several decimal digits of resolution
615     *     is acceptable.  The J2000 method is best matched to the way
616     *     the argument is handled internally and will deliver the
617     *     optimum resolution.  The MJD method and the date &amp;time methods
618     *     are both good compromises between resolution and convenience.
619     *
620     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
621     *     applying frame bias.
622     *
623     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
624     *     equinox to mean equator and equinox of date by applying
625     *     precession.
626     *
627     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
628     *     equinox of date by applying frame bias then precession.  It is
629     *     the product rp x rb.
630     *
631     * <li> It is permissible to re-use the same array in the returned
632     *     arguments.  The arrays are filled in the order given.
633     *</ol>
634     *<p>Called:<ul>
635     *     <li>{@link #jauBi00} frame bias components, IAU 2000
636     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
637     *     <li>{@link #jauIr} initialize r-matrix to identity
638     *     <li>{@link #jauRx} rotate around X-axis
639     *     <li>{@link #jauRy} rotate around Y-axis
640     *     <li>{@link #jauRz} rotate around Z-axis
641     *     <li>{@link #jauCr} copy r-matrix
642     *     <li>{@link #jauRxr} product of two r-matrices
643     * </ul>
644     *<p>Reference:
645     *     "Expressions for the Celestial Intermediate Pole and Celestial
646     *     Ephemeris Origin consistent with the IAU 2000A precession-
647     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
648     *
649     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
650     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
651     *
652     *@version 2010 January 18
653     *
654     *  @since Release 20101201
655     *
656     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
657     */
658     public static void jauBp00(final double  date1, final double date2,
659             double rb[][], double rp[][], double rbp[][])
660     {
661     /* J2000.0 obliquity (Lieske et al. 1977) */
662        final double EPS0 = 84381.448 * DAS2R;
663 
664        double t, dpsibi, depsbi;
665        double dra0, psia77, oma77, chia, dpsipr, depspr, psia, oma,
666               rbw[][] = new double[3][3];
667 
668 
669     /* Interval between fundamental epoch J2000.0 and current date (JC). */
670        t = ((date1 - DJ00) + date2) / DJC;
671 
672     /* Frame bias. */
673        FrameBias fb = jauBi00();
674        dpsibi = fb.dpsibi;
675        depsbi = fb.depsbi;
676        dra0 = fb.dra;
677     /* Precession angles (Lieske et al. 1977) */
678        psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * DAS2R;
679        oma77  =       EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * DAS2R;
680        chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
681 
682     /* Apply IAU 2000 precession corrections. */
683        PrecessionDeltaTerms pc = jauPr00(date1, date2);
684        dpsipr = pc.dpsipr;  depspr = pc.depspr;
685        psia = psia77 + dpsipr;
686        oma  = oma77  + depspr;
687 
688     /* Frame bias matrix: GCRS to J2000.0. */
689        jauIr(rbw);
690        jauRz(dra0, rbw);
691        jauRy(dpsibi * sin(EPS0), rbw);
692        jauRx(-depsbi, rbw);
693        jauCr(rbw, rb);
694 
695     /* Precession matrix: J2000.0 to mean of date. */
696        jauIr(rp);
697        jauRx(EPS0,  rp);
698        jauRz(-psia, rp);
699        jauRx(-oma,  rp);
700        jauRz(chia,  rp);
701 
702     /* Bias-precession matrix: GCRS to mean of date. */
703        double[][] rt = jauRxr(rp, rbw );
704        jauCr(rt, rbp);
705        return;
706 
707         }
708     
709 
710     /**
711     *  Frame bias and precession, IAU 2006.
712     *
713     *<p>This function is derived from the International Astronomical Union's
714     *  SOFA (Standards Of Fundamental Astronomy) software collection.
715     *
716     *<p>Status:  support function.
717     *
718     *<!-- Given: -->
719     *     @param date1 double TT as a 2-part Julian Date (Note 1)
720     *     @param date2 double TT as a 2-part Julian Date (Note 1)
721     *
722     *<!-- Returned: -->
723     *     @param rb            double[3][3]     <u>returned</u> frame bias matrix (Note 2)
724     *     @param rp            double[3][3]     <u>returned</u> precession matrix (Note 3)
725     *     @param rbp           double[3][3]     <u>returned</u> bias-precession matrix (Note 4)
726     *
727     * <p>Notes:
728     * <ol>
729     *
730     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
731     *     convenient way between the two arguments.  For example,
732     *     JD(TT)=2450123.7 could be expressed in any of these ways,
733     *     among others:
734     *<pre>
735     *             date1         date2
736     *
737     *         2450123.7           0.0       (JD method)
738     *         2451545.0       -1421.3       (J2000 method)
739     *         2400000.5       50123.2       (MJD method)
740     *         2450123.5           0.2       (date &amp;time method)
741     *</pre>
742     *     The JD method is the most natural and convenient to use in
743     *     cases where the loss of several decimal digits of resolution
744     *     is acceptable.  The J2000 method is best matched to the way
745     *     the argument is handled internally and will deliver the
746     *     optimum resolution.  The MJD method and the date &amp;time methods
747     *     are both good compromises between resolution and convenience.
748     *
749     * <li> The matrix rb transforms vectors from GCRS to mean J2000.0 by
750     *     applying frame bias.
751     *
752     * <li> The matrix rp transforms vectors from mean J2000.0 to mean of
753     *     date by applying precession.
754     *
755     * <li> The matrix rbp transforms vectors from GCRS to mean of date by
756     *     applying frame bias then precession.  It is the product rp x rb.
757     * 
758     *  <li> It is permissible to re-use the same array in the returned
759     *        arguments.  The arrays are filled in the order given.
760     *</ol>
761     *<p>Called:<ul>
762     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
763     *     <li>{@link #jauFw2m} F-W angles to r-matrix
764     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
765     *     <li>{@link #jauTr} transpose r-matrix
766     *     <li>{@link #jauRxr} product of two r-matrices
767     * </ul>
768     *<p>References:
769     *
770     *     <p>Capitaine, N. &amp;Wallace, P.T., 2006, Astron.Astrophys. 450, 855
771     *
772     *     <p>Wallace, P.T. &amp;Capitaine, N., 2006, Astron.Astrophys. 459, 981
773     *
774     *@version 2009 December 17
775     *
776     *  @since Release 20101201
777     *
778     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
779     */
780         public static void jauBp06(final double date1, final double date2,
781                  double rb[][], double rp[][], double rbp[][])
782     {
783        double rbt[][];
784 
785 
786     /* B matrix. */
787        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
788        double[][] rt = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
789        jauCr(rt, rb);
790 
791     /* PxB matrix. */
792        rt = jauPmat06(date1, date2 );
793        jauCr(rt, rbp);
794 
795     /* P matrix. */
796        rbt = jauTr(rb);
797        rt = jauRxr(rbp, rbt);
798        jauCr(rt, rp);
799 
800        return;
801 
802         }
803     
804      /**
805      * The components x,y are components of the Celestial Intermediate
806      *     Pole unit vector in the Geocentric Celestial Reference System.
807      *     
808      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Jan 2010
809      * 
810      * @since AIDA Stage 1
811      */
812     public static class CelestialIntermediatePole {
813          public double x; 
814          public double y;
815          public CelestialIntermediatePole(double x, double y) {
816             this.x = x;
817             this.y = y;
818         }
819      }
820     /**
821     *  Extract from the bias-precession-nutation matrix the X,Y coordinates
822     *  of the Celestial Intermediate Pole.
823     *
824     *<p>This function is derived from the International Astronomical Union's
825     *  SOFA (Standards Of Fundamental Astronomy) software collection.
826     *
827     *<p>Status:  support function.
828     *
829     *<!-- Given: -->
830     *     @param rbpn       double[3][3]   celestial-to-true matrix (Note 1)
831     *
832     *<!-- Returned: -->
833     *     @return     <u>returned</u> Celestial Intermediate Pole (Note 2)
834     *
835     * <p>Notes:
836     * <ol>
837     *
838     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
839     *     CIO or equinox) of date, and therefore the Celestial Intermediate
840     *     Pole unit vector is the bottom row of the matrix.
841     *
842     * <li> The arguments x,y are components of the Celestial Intermediate
843     *     Pole unit vector in the Geocentric Celestial Reference System.
844     *</ol>
845     *<p>Reference:
846     *
847     *     "Expressions for the Celestial Intermediate Pole and Celestial
848     *     Ephemeris Origin consistent with the IAU 2000A precession-
849     *     nutation model", Astron.Astrophys. 400, 1145-1154
850     *     (2003)
851     *
852     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
853     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
854     *
855     *@version 2010 January 18
856     *
857     *  @since Release 20101201
858     *
859     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
860     */
861         public static CelestialIntermediatePole  jauBpn2xy(double rbpn[][])
862     {
863     /* Extract the X,Y coordinates. */
864 
865        return new CelestialIntermediatePole(rbpn[2][0], rbpn[2][1]);
866 
867         }
868     
869 
870     /**
871     *  Form the celestial-to-intermediate matrix for a given date using the
872     *  IAU 2000A precession-nutation model.
873     *
874     *<p>This function is derived from the International Astronomical Union's
875     *  SOFA (Standards Of Fundamental Astronomy) software collection.
876     *
877     *<p>Status:  support function.
878     *
879     *<!-- Given: -->
880     *     @param date1 double TT as a 2-part Julian Date (Note 1)
881     *     @param date2 double TT as a 2-part Julian Date (Note 1)
882     *
883     *<!-- Returned: -->
884     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
885     *
886     * <p>Notes:
887     * <ol>
888     *
889     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
890     *     convenient way between the two arguments.  For example,
891     *     JD(TT)=2450123.7 could be expressed in any of these ways,
892     *     among others:
893     *<pre>
894     *            date1          date2
895     *
896     *         2450123.7           0.0       (JD method)
897     *         2451545.0       -1421.3       (J2000 method)
898     *         2400000.5       50123.2       (MJD method)
899     *         2450123.5           0.2       (date &amp;time method)
900     *</pre>
901     *     The JD method is the most natural and convenient to use in
902     *     cases where the loss of several decimal digits of resolution
903     *     is acceptable.  The J2000 method is best matched to the way
904     *     the argument is handled internally and will deliver the
905     *     optimum resolution.  The MJD method and the date &amp;time methods
906     *     are both good compromises between resolution and convenience.
907     *
908     * <li> The matrix rc2i is the first stage in the transformation from
909     *     celestial to terrestrial coordinates:
910     *
911     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
912     *
913     *               =  rc2t * [CRS]
914     *
915     *     where [CRS] is a vector in the Geocentric Celestial Reference
916     *     System and [TRS] is a vector in the International Terrestrial
917     *     Reference System (see IERS Conventions 2003), ERA is the Earth
918     *     Rotation Angle and RPOM is the polar motion matrix.
919     *
920     * <li> A faster, but slightly less accurate result (about 1 mas), can be
921     *     obtained by using instead the jauC2i00b function.
922     *</ol>
923     *<p>Called:<ul>
924     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
925     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
926     * </ul>
927     *<p>References:
928     *<ul>
929     *     <li>"Expressions for the Celestial Intermediate Pole and Celestial
930     *     Ephemeris Origin consistent with the IAU 2000A precession-
931     *     nutation model", Astron.Astrophys. 400, 1145-1154
932     *     (2003)
933     *
934     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
935     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
936     *
937     *    <li>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
938     *     IERS Technical Note No. 32, BKG (2004)
939     *</ul>
940     *@version 2010 January 18
941     *
942     *  @since Release 20101201
943     *
944     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
945     */
946     public static double[][] jauC2i00a(double date1, double date2)
947     {
948 
949 
950     /* Obtain the celestial-to-true matrix (IAU 2000A). */
951        double rbpn[][] = jauPnm00a(date1, date2);
952 
953     /* Form the celestial-to-intermediate matrix. */
954        double rc2i[][]  =jauC2ibpn(date1, date2, rbpn);
955 
956        return rc2i;
957 
958         }
959     
960 
961     /**
962     *  Form the celestial-to-intermediate matrix for a given date using the
963     *  IAU 2000B precession-nutation model.
964     *
965     *<p>This function is derived from the International Astronomical Union's
966     *  SOFA (Standards Of Fundamental Astronomy) software collection.
967     *
968     *<p>Status:  support function.
969     *
970     *<!-- Given: -->
971     *     @param date1 double TT as a 2-part Julian Date (Note 1)
972     *     @param date2 double TT as a 2-part Julian Date (Note 1)
973     *
974     *<!-- Returned: -->
975     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
976     *
977     * <p>Notes:
978     * <ol>
979     *
980     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
981     *     convenient way between the two arguments.  For example,
982     *     JD(TT)=2450123.7 could be expressed in any of these ways,
983     *     among others:
984     *<pre>
985     *            date1          date2
986     *
987     *         2450123.7           0.0       (JD method)
988     *         2451545.0       -1421.3       (J2000 method)
989     *         2400000.5       50123.2       (MJD method)
990     *         2450123.5           0.2       (date &amp;time method)
991     *</pre>
992     *     The JD method is the most natural and convenient to use in
993     *     cases where the loss of several decimal digits of resolution
994     *     is acceptable.  The J2000 method is best matched to the way
995     *     the argument is handled internally and will deliver the
996     *     optimum resolution.  The MJD method and the date &amp;time methods
997     *     are both good compromises between resolution and convenience.
998     *
999     * <li> The matrix rc2i is the first stage in the transformation from
1000     *     celestial to terrestrial coordinates:
1001     *
1002     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1003     *
1004     *               =  rc2t * [CRS]
1005     *
1006     *     where [CRS] is a vector in the Geocentric Celestial Reference
1007     *     System and [TRS] is a vector in the International Terrestrial
1008     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1009     *     Rotation Angle and RPOM is the polar motion matrix.
1010     *
1011     * <li> The present function is faster, but slightly less accurate (about
1012     *     1 mas), than the jauC2i00a function.
1013     *</ol>
1014     *<p>Called:<ul>
1015     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
1016     *     <li>{@link #jauC2ibpn} celestial-to-intermediate matrix, given NPB matrix
1017     * </ul>
1018     *<p>References:
1019     *
1020     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1021     *     Ephemeris Origin consistent with the IAU 2000A precession-
1022     *     nutation model", Astron.Astrophys. 400, 1145-1154
1023     *     (2003)
1024     *
1025     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1026     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1027     *
1028     *    <p> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1029     *     IERS Technical Note No. 32, BKG (2004)
1030     *
1031     *@version 2010 January 18
1032     *
1033     *  @since Release 20101201
1034     *
1035     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1036     */
1037     public static double[][] jauC2i00b(double date1, double date2)
1038     {
1039        double rbpn[][];
1040        double rc2i[][];
1041 
1042     /* Obtain the celestial-to-true matrix (IAU 2000B). */
1043        rbpn = jauPnm00b(date1, date2 );
1044 
1045     /* Form the celestial-to-intermediate matrix. */
1046        rc2i = jauC2ibpn(date1, date2, rbpn);
1047 
1048        return rc2i;
1049 
1050         }
1051     
1052 
1053     /**
1054     *  Form the celestial-to-intermediate matrix for a given date using the
1055     *  IAU 2006 precession and IAU 2000A nutation models.
1056     *
1057     *<p>This function is derived from the International Astronomical Union's
1058     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1059     *
1060     *<p>Status:  support function.
1061     *
1062     *<!-- Given: -->
1063     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1064     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1065     *
1066     *<!-- Returned: -->
1067     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 2)
1068     *
1069     * <p>Notes:
1070     * <ol>
1071     *
1072     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1073     *     convenient way between the two arguments.  For example,
1074     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1075     *     among others:
1076     *<pre>
1077     *            date1          date2
1078     *
1079     *         2450123.7           0.0       (JD method)
1080     *         2451545.0       -1421.3       (J2000 method)
1081     *         2400000.5       50123.2       (MJD method)
1082     *         2450123.5           0.2       (date &amp;time method)
1083     *</pre>
1084     *     The JD method is the most natural and convenient to use in
1085     *     cases where the loss of several decimal digits of resolution
1086     *     is acceptable.  The J2000 method is best matched to the way
1087     *     the argument is handled internally and will deliver the
1088     *     optimum resolution.  The MJD method and the date &amp;time methods
1089     *     are both good compromises between resolution and convenience.
1090     *
1091     * <li> The matrix rc2i is the first stage in the transformation from
1092     *     celestial to terrestrial coordinates:
1093     *
1094     *        [TRS]  =  RPOM * R_3(ERA) * rc2i * [CRS]
1095     *
1096     *               =  RC2T * [CRS]
1097     *
1098     *     where [CRS] is a vector in the Geocentric Celestial Reference
1099     *     System and [TRS] is a vector in the International Terrestrial
1100     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1101     *     Rotation Angle and RPOM is the polar motion matrix.
1102     *</ol>
1103     *<p>Called:<ul>
1104     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
1105     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1106     *     <li>{@link #jauS06} the CIO locator s, Given X,Y, IAU 2006
1107     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, Given X,Y and s
1108     * </ul>
1109     *<p>References:
1110     *
1111     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1112     *     IERS Technical Note No. 32, BKG
1113     *
1114     *@version 2008 May 13
1115     *
1116     *  @since Release 20101201
1117     *
1118     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1119     */
1120     public static double[][] jauC2i06a(double date1, double date2)
1121     {
1122        double rbpn[][], s,  rc2i[][];
1123 
1124 
1125     /* Obtain the celestial-to-true matrix (IAU 2006/2000A). */
1126        rbpn = jauPnm06a(date1, date2);
1127 
1128     /* Extract the X,Y coordinates. */
1129        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1130 
1131     /* Obtain the CIO locator. */
1132        s = jauS06(date1, date2, cip.x, cip.y);
1133 
1134     /* Form the celestial-to-intermediate matrix. */
1135        rc2i = jauC2ixys(cip.x, cip.y, s);
1136 
1137        return rc2i;
1138 
1139         }
1140     
1141 
1142     /**
1143     *  Form the celestial-to-intermediate matrix for a given date given
1144     *  the bias-precession-nutation matrix.  IAU 2000.
1145     *
1146     *<p>This function is derived from the International Astronomical Union's
1147     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1148     *
1149     *<p>Status:  support function.
1150     *
1151     *<!-- Given: -->
1152     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1153     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1154     *     @param rbpn         double[3][3]  celestial-to-true matrix (Note 2)
1155     *
1156     *<!-- Returned: -->
1157     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1158     *
1159     * <p>Notes:
1160     * <ol>
1161     *
1162     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1163     *     convenient way between the two arguments.  For example,
1164     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1165     *     among others:
1166     *<pre>
1167     *            date1          date2
1168     *
1169     *         2450123.7           0.0       (JD method)
1170     *         2451545.0       -1421.3       (J2000 method)
1171     *         2400000.5       50123.2       (MJD method)
1172     *         2450123.5           0.2       (date &amp;time method)
1173     *</pre>
1174     *     The JD method is the most natural and convenient to use in
1175     *     cases where the loss of several decimal digits of resolution
1176     *     is acceptable.  The J2000 method is best matched to the way
1177     *     the argument is handled internally and will deliver the
1178     *     optimum resolution.  The MJD method and the date &amp;time methods
1179     *     are both good compromises between resolution and convenience.
1180     *
1181     * <li> The matrix rbpn transforms vectors from GCRS to true equator (and
1182     *     CIO or equinox) of date.  Only the CIP (bottom row) is used.
1183     *
1184     * <li> The matrix rc2i is the first stage in the transformation from
1185     *     celestial to terrestrial coordinates:
1186     *
1187     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1188     *
1189     *              = RC2T * [CRS]
1190     *
1191     *     where [CRS] is a vector in the Geocentric Celestial Reference
1192     *     System and [TRS] is a vector in the International Terrestrial
1193     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1194     *     Rotation Angle and RPOM is the polar motion matrix.
1195     *
1196     * <li> Although its name does not include "00", This function is in fact
1197     *     specific to the IAU 2000 models.
1198     *</ol>
1199     *<p>Called:<ul>
1200     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
1201     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
1202     * </ul>
1203     *<p>References:
1204     *    <p> "Expressions for the Celestial Intermediate Pole and Celestial
1205     *     Ephemeris Origin consistent with the IAU 2000A precession-
1206     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
1207     *
1208     *     <p>n.b. The celestial ephemeris origin (CEO) was renamed "celestial
1209     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
1210     *
1211     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1212     *     IERS Technical Note No. 32, BKG (2004)
1213     *
1214     *@version 2010 January 18
1215     *
1216     *  @since Release 20101201
1217     *
1218     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1219     */
1220     public static double[][] jauC2ibpn(double date1, double date2, double rbpn[][])
1221     {
1222 
1223     /* Extract the X,Y coordinates. */
1224        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
1225        
1226        
1227     /* Form the celestial-to-intermediate matrix (n.b. IAU 2000 specific). */
1228        double rc2i[][] =jauC2ixy(date1, date2, cip.x, cip.y);
1229 
1230        return rc2i;
1231 
1232         }
1233     
1234 
1235     /**
1236     *  Form the celestial to intermediate-frame-of-date matrix for a given
1237     *  date when the CIP X,Y coordinates are known.  IAU 2000.
1238     *
1239     *<p>This function is derived from the International Astronomical Union's
1240     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1241     *
1242     *<p>Status:  support function.
1243     *
1244     *<!-- Given: -->
1245     *     @param date1 double TT as a 2-part Julian Date (Note 1)
1246     *     @param date2 double TT as a 2-part Julian Date (Note 1)
1247     *     @param x double        Celestial Intermediate Pole (Note 2)
1248     *     @param y double        Celestial Intermediate Pole (Note 2) 
1249     *
1250     *<!-- Returned: -->
1251     *     @return rc2i         double[3][3]   <u>returned</u> celestial-to-intermediate matrix (Note 3)
1252     *
1253     * <p>Notes:
1254     * <ol>
1255     *
1256     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
1257     *     convenient way between the two arguments.  For example,
1258     *     JD(TT)=2450123.7 could be expressed in any of these ways,
1259     *     among others:
1260     *<pre>
1261     *            date1          date2
1262     *
1263     *         2450123.7           0.0       (JD method)
1264     *         2451545.0       -1421.3       (J2000 method)
1265     *         2400000.5       50123.2       (MJD method)
1266     *         2450123.5           0.2       (date &amp;time method)
1267     *</pre>
1268     *     The JD method is the most natural and convenient to use in
1269     *     cases where the loss of several decimal digits of resolution
1270     *     is acceptable.  The J2000 method is best matched to the way
1271     *     the argument is handled internally and will deliver the
1272     *     optimum resolution.  The MJD method and the date &amp;time methods
1273     *     are both good compromises between resolution and convenience.
1274     *
1275     * <li> The Celestial Intermediate Pole coordinates are the x,y components
1276     *     of the unit vector in the Geocentric Celestial Reference System.
1277     *
1278     * <li> The matrix rc2i is the first stage in the transformation from
1279     *     celestial to terrestrial coordinates:
1280     *
1281     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1282     *
1283     *              = RC2T * [CRS]
1284     *
1285     *     where [CRS] is a vector in the Geocentric Celestial Reference
1286     *     System and [TRS] is a vector in the International Terrestrial
1287     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1288     *     Rotation Angle and RPOM is the polar motion matrix.
1289     *
1290     * <li> Although its name does not include "00", This function is in fact
1291     *     specific to the IAU 2000 models.
1292     *</ol>
1293     *<p>Called:<ul>
1294     *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
1295     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
1296     * </ul>
1297     *<p>Reference:
1298     *
1299     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1300     *     IERS Technical Note No. 32, BKG (2004)
1301     *
1302     *@version 2008 May 11
1303     *
1304     *  @since Release 20101201
1305     *
1306     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1307     */
1308 
1309     public static  double[][] jauC2ixy(double date1, double date2, double x, double y)
1310     {
1311     /* Compute s and then the matrix. */
1312        double rc2i[][] = jauC2ixys(x, y, jauS00(date1, date2, x, y));
1313 
1314        return rc2i;
1315 
1316         }
1317     
1318 
1319     /**
1320     *  Form the celestial to intermediate-frame-of-date matrix given the CIP
1321     *  X,Y and the CIO locator s.
1322     *
1323     *<p>This function is derived from the International Astronomical Union's
1324     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1325     *
1326     *<p>Status:  support function.
1327     *
1328     *<!-- Given: -->
1329     *     @param x double          Celestial Intermediate Pole (Note 1)
1330     *     @param y double          Celestial Intermediate Pole (Note 1) 
1331     *     @param s         double          the CIO locator s (Note 2)
1332     *
1333     *<!-- Returned: -->
1334     *     @return rc2i      double[3][3]     <u>returned</u> celestial-to-intermediate matrix (Note 3)
1335     *
1336     * <p>Notes:
1337     * <ol>
1338     *
1339     * <li> The Celestial Intermediate Pole coordinates are the x,y
1340     *     components of the unit vector in the Geocentric Celestial
1341     *     Reference System.
1342     *
1343     * <li> The CIO locator s (in radians) positions the Celestial
1344     *     Intermediate Origin on the equator of the CIP.
1345     *
1346     * <li> The matrix rc2i is the first stage in the transformation from
1347     *     celestial to terrestrial coordinates:
1348     *
1349     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1350     *
1351     *              = RC2T * [CRS]
1352     *
1353     *     where [CRS] is a vector in the Geocentric Celestial Reference
1354     *     System and [TRS] is a vector in the International Terrestrial
1355     *     Reference System (see IERS Conventions 2003), ERA is the Earth
1356     *     Rotation Angle and RPOM is the polar motion matrix.
1357     *</ol>
1358     *<p>Called:<ul>
1359     *     <li>{@link #jauIr} initialize r-matrix to identity
1360     *     <li>{@link #jauRz} rotate around Z-axis
1361     *     <li>{@link #jauRy} rotate around Y-axis
1362     * </ul>
1363     *<p>Reference:
1364     *
1365     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1366     *     IERS Technical Note No. 32, BKG (2004)
1367     *
1368     *@version 2008 May 11
1369     *
1370     *  @since Release 20101201
1371     *
1372     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1373     */
1374     public static double[][] jauC2ixys(double x, double y, double s)
1375     {
1376        double r2, e, d;
1377        double rc2i[][] = new double[3][3];
1378 
1379     /* Obtain the spherical angles E and d. */
1380        r2 = x*x + y*y;
1381        e = (r2 > 0.0) ? atan2(y, x) : 0.0;
1382        d = atan(sqrt(r2 / (1.0 - r2)));
1383 
1384     /* Form the matrix. */
1385        jauIr(rc2i);
1386        jauRz(e, rc2i);
1387        jauRy(d, rc2i);
1388        jauRz(-(e+s), rc2i);
1389 
1390        return rc2i;
1391 
1392         }
1393     
1394     /**
1395     *  P-vector to spherical coordinates.
1396     *
1397     *<p>This function is derived from the International Astronomical Union's
1398     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1399     *
1400     *<p>Status:  vector/matrix support function.
1401     *
1402     *<!-- Given: -->
1403     *     @param p       double[3]     p-vector
1404     *
1405     *<!-- Returned: -->
1406     *     @return theta   double         <u>returned</u> longitude angle (radians)
1407     *             phi     double         <u>returned</u> latitude angle (radians)
1408     *
1409     * <p>Notes:
1410     * <ol>
1411     *
1412     * <li> The vector p can have any magnitude; only its direction is used.
1413     *
1414     * <li> If p is null, zero theta and phi are returned.
1415     *
1416     * <li> At either pole, zero theta is returned.
1417     *</ol>
1418     *@version 2008 May 11
1419     *
1420     *  @since Release 20101201
1421     *
1422     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1423     */
1424     public static SphericalCoordinate jauC2s(double p[])
1425     {
1426        double x, y, z, d2;
1427 
1428 
1429        x  = p[0];
1430        y  = p[1];
1431        z  = p[2];
1432        d2 = x*x + y*y;
1433 
1434        double theta = (d2 == 0.0) ? 0.0 : atan2(y, x);
1435        double phi = (z == 0.0) ? 0.0 : atan2(z, sqrt(d2));
1436 
1437        return new SphericalCoordinate(theta, phi);
1438 
1439         }
1440     
1441 
1442     /**
1443     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1444     *  the polar motion, using the IAU 2000A nutation model.
1445     *
1446     *<p>This function is derived from the International Astronomical Union's
1447     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1448     *
1449     *<p>Status:  support function.
1450     *
1451     *<!-- Given: -->
1452     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1453     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1454     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1455     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1456     *     @param xp double          coordinates of the pole (radians, Note 2)
1457     *     @param yp double          coordinates of the pole (radians, Note 2) 
1458     *
1459     *<!-- Returned: -->
1460     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1461     *
1462     * <p>Notes:
1463     * <ol>
1464     *
1465     *   <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1466     *     apportioned in any convenient way between the arguments uta and
1467     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1468     *     these ways, among others:
1469     *<pre>
1470     *             uta            utb
1471     *
1472     *         2450123.7           0.0       (JD method)
1473     *         2451545.0       -1421.3       (J2000 method)
1474     *         2400000.5       50123.2       (MJD method)
1475     *         2450123.5           0.2       (date &amp;time method)
1476     *</pre>
1477     *     The JD method is the most natural and convenient to use in
1478     *     cases where the loss of several decimal digits of resolution is
1479     *     acceptable.  The J2000 and MJD methods are good compromises
1480     *     between resolution and convenience.  In the case of uta,utb, the
1481     *     date &amp;time method is best matched to the Earth rotation angle
1482     *     algorithm used:  maximum precision is delivered when the uta
1483     *     argument is for 0hrs UT1 on the day in question and the utb
1484     *     argument lies in the range 0 to 1, or vice versa.
1485     *
1486     *  <li> The arguments xp and yp are the coordinates (in radians) of the
1487     *     Celestial Intermediate Pole with respect to the International
1488     *     Terrestrial Reference System (see IERS Conventions 2003),
1489     *     measured along the meridians to 0 and 90 deg west respectively.
1490     *
1491     * <li> The matrix rc2t transforms from celestial to terrestrial
1492     *     coordinates:
1493     *
1494     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1495     *
1496     *              = rc2t * [CRS]
1497     *
1498     *     where [CRS] is a vector in the Geocentric Celestial Reference
1499     *     System and [TRS] is a vector in the International Terrestrial
1500     *     Reference System (see IERS Conventions 2003), RC2I is the
1501     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1502     *     angle and RPOM is the polar motion matrix.
1503     *
1504     * <li> A faster, but slightly less accurate result (about 1 mas), can
1505     *     be obtained by using instead the jauC2t00b function.
1506     *</ol>
1507     *<p>Called:<ul>
1508     *     <li>{@link #jauC2i00a} celestial-to-intermediate matrix, IAU 2000A
1509     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1510     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1511     *     <li>{@link #jauPom00} polar motion matrix
1512     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1513     * </ul>
1514     *<p>Reference:
1515     *
1516     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1517     *     IERS Technical Note No. 32, BKG (2004)
1518     *
1519     *@version 2009 April 1
1520     *
1521     *  @since Release 20101201
1522     *
1523     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1524     */
1525     public static  double[][] jauC2t00a(final double tta, final double ttb, final double uta, final double utb,
1526                    final double xp, final double yp)
1527     {
1528        double rc2i[][]= new double[3][3], era, sp, rpom[][];
1529 
1530 
1531     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000A). */
1532        rc2i = jauC2i00a(tta, ttb);
1533 
1534     /* Predict the Earth rotation angle for this UT1. */
1535        era = jauEra00(uta, utb);
1536 
1537     /* Estimate s'. */
1538        sp = jauSp00(tta, ttb);
1539 
1540     /* Form the polar motion matrix. */
1541        rpom = jauPom00(xp, yp, sp );
1542 
1543     /* Combine to form the celestial-to-terrestrial matrix. */
1544        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
1545 
1546        return rc2t;
1547 
1548         }
1549     
1550 
1551     /**
1552     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1553     *  the polar motion, using the IAU 2000B nutation model.
1554     *
1555     *<p>This function is derived from the International Astronomical Union's
1556     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1557     *
1558     *<p>Status:  support function.
1559     *
1560     *<!-- Given: -->
1561     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1562     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1563     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1564     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1565     *     @param xp double          coordinates of the pole (radians, Note 2)
1566     *     @param yp double          coordinates of the pole (radians, Note 2) 
1567     *
1568     *<!-- Returned: -->
1569     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1570     *
1571     * <p>Notes:
1572     * <ol>
1573     *
1574     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1575     *     apportioned in any convenient way between the arguments uta and
1576     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1577     *     these ways, among others:
1578     *<pre>
1579     *             uta            utb
1580     *
1581     *         2450123.7           0.0       (JD method)
1582     *         2451545.0       -1421.3       (J2000 method)
1583     *         2400000.5       50123.2       (MJD method)
1584     *         2450123.5           0.2       (date &amp;time method)
1585     *</pre>
1586     *     The JD method is the most natural and convenient to use in
1587     *     cases where the loss of several decimal digits of resolution is
1588     *     acceptable.  The J2000 and MJD methods are good compromises
1589     *     between resolution and convenience.  In the case of uta,utb, the
1590     *     date &amp;time method is best matched to the Earth rotation angle
1591     *     algorithm used:  maximum precision is delivered when the uta
1592     *     argument is for 0hrs UT1 on the day in question and the utb
1593     *     argument lies in the range 0 to 1, or vice versa.
1594     *
1595     * <li> The arguments xp and yp are the coordinates (in radians) of the
1596     *     Celestial Intermediate Pole with respect to the International
1597     *     Terrestrial Reference System (see IERS Conventions 2003),
1598     *     measured along the meridians to 0 and 90 deg west respectively.
1599     *
1600     * <li> The matrix rc2t transforms from celestial to terrestrial
1601     *     coordinates:
1602     *
1603     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1604     *
1605     *              = rc2t * [CRS]
1606     *
1607     *     where [CRS] is a vector in the Geocentric Celestial Reference
1608     *     System and [TRS] is a vector in the International Terrestrial
1609     *     Reference System (see IERS Conventions 2003), RC2I is the
1610     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1611     *     angle and RPOM is the polar motion matrix.
1612     *
1613     * <li> The present function is faster, but slightly less accurate (about
1614     *     1 mas), than the jauC2t00a function.
1615     *</ol>
1616     *<p>Called:<ul>
1617     *     <li>{@link #jauC2i00b} celestial-to-intermediate matrix, IAU 2000B
1618     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1619     *     <li>{@link #jauPom00} polar motion matrix
1620     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1621     * </ul>
1622     *<p>Reference:
1623     *
1624     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1625     *     IERS Technical Note No. 32, BKG (2004)
1626     *
1627     *@version 2009 April 1
1628     *
1629     *  @since Release 20101201
1630     *
1631     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1632     */
1633     public static double[][] jauC2t00b(final double tta, final double ttb, final double uta, final double utb,
1634                    final double xp, final double yp )
1635     {
1636        double rc2i[][], era, rpom[][];
1637        double rc2t[][];
1638 
1639     /* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */
1640        rc2i =jauC2i00b(tta, ttb);
1641 
1642     /* Predict the Earth rotation angle for this UT1. */
1643        era = jauEra00(uta, utb);
1644 
1645     /* Form the polar motion matrix (neglecting s'). */
1646        rpom = jauPom00(xp, yp, 0.0 );
1647 
1648     /* Combine to form the celestial-to-terrestrial matrix. */
1649        rc2t = jauC2tcio(rc2i, era, rpom );
1650 
1651        return rc2t;
1652 
1653         }
1654     
1655 
1656     /**
1657     *  Form the celestial to terrestrial matrix given the date, the UT1 and
1658     *  the polar motion, using the IAU 2006 precession and IAU 2000A
1659     *  nutation models.
1660     *
1661     *<p>This function is derived from the International Astronomical Union's
1662     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1663     *
1664     *<p>Status:  support function.
1665     *
1666     *<!-- Given: -->
1667     *     @param tta double          TT as a 2-part Julian Date (Note 1)
1668     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
1669     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
1670     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
1671     *     @param xp double          coordinates of the pole (radians, Note 2)
1672     *     @param yp double          coordinates of the pole (radians, Note 2) 
1673     *
1674     *<!-- Returned: -->
1675     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 3)
1676     *
1677     * <p>Notes:
1678     * <ol>
1679     *
1680     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1681     *     apportioned in any convenient way between the arguments uta and
1682     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1683     *     these ways, among others:
1684     *<pre>
1685     *             uta            utb
1686     *
1687     *         2450123.7           0.0       (JD method)
1688     *         2451545.0       -1421.3       (J2000 method)
1689     *         2400000.5       50123.2       (MJD method)
1690     *         2450123.5           0.2       (date &amp;time method)
1691     *</pre>
1692     *     The JD method is the most natural and convenient to use in
1693     *     cases where the loss of several decimal digits of resolution is
1694     *     acceptable.  The J2000 and MJD methods are good compromises
1695     *     between resolution and convenience.  In the case of uta,utb, the
1696     *     date &amp;time method is best matched to the Earth rotation angle
1697     *     algorithm used:  maximum precision is delivered when the uta
1698     *     argument is for 0hrs UT1 on the day in question and the utb
1699     *     argument lies in the range 0 to 1, or vice versa.
1700     *
1701     * <li> The arguments xp and yp are the coordinates (in radians) of the
1702     *     Celestial Intermediate Pole with respect to the International
1703     *     Terrestrial Reference System (see IERS Conventions 2003),
1704     *     measured along the meridians to 0 and 90 deg west respectively.
1705     *
1706     * <li> The matrix rc2t transforms from celestial to terrestrial
1707     *     coordinates:
1708     *
1709     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
1710     *
1711     *              = rc2t * [CRS]
1712     *
1713     *     where [CRS] is a vector in the Geocentric Celestial Reference
1714     *     System and [TRS] is a vector in the International Terrestrial
1715     *     Reference System (see IERS Conventions 2003), RC2I is the
1716     *     celestial-to-intermediate matrix, ERA is the Earth rotation
1717     *     angle and RPOM is the polar motion matrix.
1718     *</ol>
1719     *<p>Called:<ul>
1720     *     <li>{@link #jauC2i06a} celestial-to-intermediate matrix, IAU 2006/2000A
1721     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
1722     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1723     *     <li>{@link #jauPom00} polar motion matrix
1724     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
1725     * </ul>
1726     *<p>Reference:
1727     *
1728     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1729     *     IERS Technical Note No. 32, BKG
1730     *
1731     *@version 2009 April 1
1732     *
1733     *  @since Release 20101201
1734     *
1735     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1736     */
1737     public static double[][] jauC2t06a(final double tta, final double ttb, final double uta, final double utb,
1738                   final double xp, final double yp)
1739     {
1740        double rc2i[][], era, sp, rpom[][], rc2t[][];
1741 
1742 
1743     /* Form the celestial-to-intermediate matrix for this TT. */
1744        rc2i = jauC2i06a(tta, ttb);
1745 
1746     /* Predict the Earth rotation angle for this UT1. */
1747        era = jauEra00(uta, utb);
1748 
1749     /* Estimate s'. */
1750        sp = jauSp00(tta, ttb);
1751 
1752     /* Form the polar motion matrix. */
1753        rpom = jauPom00(xp, yp, sp );
1754 
1755     /* Combine to form the celestial-to-terrestrial matrix. */
1756        rc2t = jauC2tcio(rc2i, era, rpom );
1757 
1758        return rc2t;
1759 
1760         }
1761     
1762 
1763     /**
1764     *  Assemble the celestial to terrestrial matrix from CIO-based
1765     *  components (the celestial-to-intermediate matrix, the Earth Rotation
1766     *  Angle and the polar motion matrix).
1767     *
1768     *<p>This function is derived from the International Astronomical Union's
1769     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1770     *
1771     *<p>Status:  support function.
1772     *
1773     *<!-- Given: -->
1774     *     @param rc2i      double[3][3]     celestial-to-intermediate matrix
1775     *     @param era       double           Earth rotation angle (radians)
1776     *     @param rpom      double[3][3]     polar-motion matrix
1777     *
1778     *<!-- Returned: -->
1779     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix
1780     *
1781     * <p>Notes:
1782     * <ol>
1783     *
1784     * <li> This function constructs the rotation matrix that transforms
1785     *     vectors in the celestial system into vectors in the terrestrial
1786     *     system.  It does so starting from precomputed components, namely
1787     *     the matrix which rotates from celestial coordinates to the
1788     *     intermediate frame, the Earth rotation angle and the polar motion
1789     *     matrix.  One use of the present function is when generating a
1790     *     series of celestial-to-terrestrial matrices where only the Earth
1791     *     Rotation Angle changes, avoiding the considerable overhead of
1792     *     recomputing the precession-nutation more often than necessary to
1793     *     achieve given accuracy objectives.
1794     *
1795     * <li> The relationship between the arguments is as follows:
1796     *
1797     *        [TRS] = RPOM * R_3(ERA) * rc2i * [CRS]
1798     *
1799     *              = rc2t * [CRS]
1800     *
1801     *     where [CRS] is a vector in the Geocentric Celestial Reference
1802     *     System and [TRS] is a vector in the International Terrestrial
1803     *     Reference System (see IERS Conventions 2003).
1804     *</ol>
1805     *<p>Called:<ul>
1806     *     <li>{@link #jauCr} copy r-matrix
1807     *     <li>{@link #jauRz} rotate around Z-axis
1808     *     <li>{@link #jauRxr} product of two r-matrices
1809     * </ul>
1810     *<p>Reference:
1811     *
1812     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
1813     *     IERS Technical Note No. 32, BKG
1814     *
1815     *@version 2008 May 11
1816     *
1817     *  @since Release 20101201
1818     *
1819     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1820     */
1821     public static double[][] jauC2tcio(final double rc2i[][], final double era, final double rpom[][])
1822     {
1823        double r[][] = new double[3][3];
1824 
1825 
1826     /* Construct the matrix. */
1827        jauCr(rc2i, r);
1828        jauRz(era, r);
1829        double[][] rc2t = jauRxr(rpom, r);
1830 
1831        return rc2t;
1832 
1833         }
1834     
1835 
1836     /**
1837     *  Assemble the celestial to terrestrial matrix from equinox-based
1838     *  components (the celestial-to-true matrix, the Greenwich Apparent
1839     *  Sidereal Time and the polar motion matrix).
1840     *
1841     *<p>This function is derived from the International Astronomical Union's
1842     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1843     *
1844     *<p>Status:  support function.
1845     *
1846     *<!-- Given: -->
1847     *     @param rbpn      double[3][3]     celestial-to-true matrix
1848     *     @param gst       double           Greenwich (apparent) Sidereal Time (radians)
1849     *     @param rpom      double[3][3]     polar-motion matrix
1850     *
1851     *<!-- Returned: -->
1852     *     @return rc2t      double[3][3]      <u>returned</u> celestial-to-terrestrial matrix (Note 2)
1853     *
1854     * <p>Notes:
1855     * <ol>
1856     *
1857     * <li> This function constructs the rotation matrix that transforms
1858     *     vectors in the celestial system into vectors in the terrestrial
1859     *     system.  It does so starting from precomputed components, namely
1860     *     the matrix which rotates from celestial coordinates to the
1861     *     true equator and equinox of date, the Greenwich Apparent Sidereal
1862     *     Time and the polar motion matrix.  One use of the present function
1863     *     is when generating a series of celestial-to-terrestrial matrices
1864     *     where only the Sidereal Time changes, avoiding the considerable
1865     *     overhead of recomputing the precession-nutation more often than
1866     *     necessary to achieve given accuracy objectives.
1867     *
1868     * <li> The relationship between the arguments is as follows:
1869     *
1870     *        [TRS] = rpom * R_3(gst) * rbpn * [CRS]
1871     *
1872     *              = rc2t * [CRS]
1873     *
1874     *     where [CRS] is a vector in the Geocentric Celestial Reference
1875     *     System and [TRS] is a vector in the International Terrestrial
1876     *     Reference System (see IERS Conventions 2003).
1877     *</ol>
1878     *<p>Called:<ul>
1879     *     <li>{@link #jauCr} copy r-matrix
1880     *     <li>{@link #jauRz} rotate around Z-axis
1881     *     <li>{@link #jauRxr} product of two r-matrices
1882     * </ul>
1883     *<p>Reference:
1884     *
1885     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1886     *     IERS Technical Note No. 32, BKG (2004)
1887     *
1888     *@version 2008 May 11
1889     *
1890     *  @since Release 20101201
1891     *
1892     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
1893     */
1894     public static double[][] jauC2teqx(final double rbpn[][], final double gst, final double rpom[][] )
1895     {
1896        double r[][] = new double[3][3], rc2t[][];
1897 
1898 
1899     /* Construct the matrix. */
1900        jauCr(rbpn, r);
1901        jauRz(gst, r);
1902        rc2t = jauRxr(rpom, r);
1903 
1904        return rc2t;
1905 
1906         }
1907     
1908 
1909     /**
1910     *  Form the celestial to terrestrial matrix given the date, the UT1,
1911     *  the nutation and the polar motion.  IAU 2000.
1912     *
1913     *<p>This function is derived from the International Astronomical Union's
1914     *  SOFA (Standards Of Fundamental Astronomy) software collection.
1915     *
1916     *<p>Status:  support function.
1917     *
1918     *<!-- Given: -->
1919     *     @param tta double         TT as a 2-part Julian Date (Note 1)
1920     *     @param ttb double         TT as a 2-part Julian Date (Note 1) 
1921     *     @param uta double         UT1 as a 2-part Julian Date (Note 1)
1922     *     @param utb double         UT1 as a 2-part Julian Date (Note 1) 
1923     *     @param dpsi double         nutation (Note 2)
1924     *     @param deps double         nutation (Note 2) 
1925     *     @param xp double         coordinates of the pole (radians, Note 3)
1926     *     @param yp double         coordinates of the pole (radians, Note 3) 
1927     *
1928     *<!-- Returned: -->
1929     *     @return rc2t        double[3][3]    <u>returned</u> celestial-to-terrestrial matrix (Note 4)
1930     *
1931     * <p>Notes:
1932     * <ol>
1933     *
1934     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
1935     *     apportioned in any convenient way between the arguments uta and
1936     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
1937     *     these ways, among others:
1938     *<pre>
1939     *             uta            utb
1940     *
1941     *         2450123.7           0.0       (JD method)
1942     *         2451545.0       -1421.3       (J2000 method)
1943     *         2400000.5       50123.2       (MJD method)
1944     *         2450123.5           0.2       (date &amp;time method)
1945     *</pre>
1946     *     The JD method is the most natural and convenient to use in
1947     *     cases where the loss of several decimal digits of resolution is
1948     *     acceptable.  The J2000 and MJD methods are good compromises
1949     *     between resolution and convenience.  In the case of uta,utb, the
1950     *     date &amp;time method is best matched to the Earth rotation angle
1951     *     algorithm used:  maximum precision is delivered when the uta
1952     *     argument is for 0hrs UT1 on the day in question and the utb
1953     *     argument lies in the range 0 to 1, or vice versa.
1954     *
1955     * <li> The caller is responsible for providing the nutation components;
1956     *     they are in longitude and obliquity, in radians and are with
1957     *     respect to the equinox and ecliptic of date.  For high-accuracy
1958     *     applications, free core nutation should be included as well as
1959     *     any other relevant corrections to the position of the CIP.
1960     *
1961     * <li> The arguments xp and yp are the coordinates (in radians) of the
1962     *     Celestial Intermediate Pole with respect to the International
1963     *     Terrestrial Reference System (see IERS Conventions 2003),
1964     *     measured along the meridians to 0 and 90 deg west respectively.
1965     *
1966     * <li> The matrix rc2t transforms from celestial to terrestrial
1967     *     coordinates:
1968     *
1969     *        [TRS] = RPOM * R_3(GST) * RBPN * [CRS]
1970     *
1971     *              = rc2t * [CRS]
1972     *
1973     *     where [CRS] is a vector in the Geocentric Celestial Reference
1974     *     System and [TRS] is a vector in the International Terrestrial
1975     *     Reference System (see IERS Conventions 2003), RBPN is the
1976     *     bias-precession-nutation matrix, GST is the Greenwich (apparent)
1977     *     Sidereal Time and RPOM is the polar motion matrix.
1978     *
1979     * <li> Although its name does not include "00", This function is in fact
1980     *     specific to the IAU 2000 models.
1981     *</ol>
1982     *<p>Called:<ul>
1983     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
1984     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
1985     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
1986     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
1987     *     <li>{@link #jauPom00} polar motion matrix
1988     *     <li>{@link #jauC2teqx} form equinox-based celestial-to-terrestrial matrix
1989     * </ul>
1990     *<p>Reference:
1991     *
1992     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
1993     *     IERS Technical Note No. 32, BKG (2004)
1994     *
1995     *@version 2009 April 1
1996     *
1997     *  @since Release 20101201
1998     *
1999     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2000     */
2001     public static double[][] jauC2tpe(final double tta, final double ttb, final double uta, final double utb,
2002             final double dpsi, final double deps, final double xp, final double yp)
2003     {
2004        double rpom[][]; 
2005 
2006     /* Form the celestial-to-true matrix for this TT. */
2007        PrecessionNutation pn = jauPn00(tta, ttb, dpsi, deps);
2008 
2009     /* Predict the Greenwich Mean Sidereal Time for this UT1 and TT. */
2010        double gmst = jauGmst00(uta, utb, tta, ttb);
2011 
2012     /* Predict the equation of the equinoxes given TT and nutation. */
2013        double ee = jauEe00(tta, ttb, pn.epsa, dpsi);
2014 
2015     /* Estimate s'. */
2016        double sp = jauSp00(tta, ttb);
2017 
2018     /* Form the polar motion matrix. */
2019        rpom = jauPom00(xp, yp, sp);
2020 
2021     /* Combine to form the celestial-to-terrestrial matrix. */
2022        double[][] rc2t = jauC2teqx(pn.rbpn, gmst + ee, rpom );
2023 
2024        return rc2t;
2025 
2026         }
2027     
2028 
2029     /**
2030     *  Form the celestial to terrestrial matrix given the date, the UT1,
2031     *  the CIP coordinates and the polar motion.  IAU 2000.
2032     *
2033     *<p>This function is derived from the International Astronomical Union's
2034     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2035     *
2036     *<p>Status:  support function.
2037     *
2038     *<!-- Given: -->
2039     *     @param tta double          TT as a 2-part Julian Date (Note 1)
2040     *     @param ttb double          TT as a 2-part Julian Date (Note 1) 
2041     *     @param uta double          UT1 as a 2-part Julian Date (Note 1)
2042     *     @param utb double          UT1 as a 2-part Julian Date (Note 1) 
2043     *     @param x double          Celestial Intermediate Pole (Note 2)
2044     *     @param y double          Celestial Intermediate Pole (Note 2) 
2045     *     @param xp double          coordinates of the pole (radians, Note 3)
2046     *     @param yp double          coordinates of the pole (radians, Note 3) 
2047     *
2048     *<!-- Returned: -->
2049     *     @return rc2t      double[3][3]     <u>returned</u> celestial-to-terrestrial matrix (Note 4)
2050     *
2051     * <p>Notes:
2052     * <ol>
2053     *
2054     * <li> The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
2055     *     apportioned in any convenient way between the arguments uta and
2056     *     utb.  For example, JD(UT1)=2450123.7 could be expressed in any o
2057     *     these ways, among others:
2058     *<pre>
2059     *             uta            utb
2060     *
2061     *         2450123.7           0.0       (JD method)
2062     *         2451545.0       -1421.3       (J2000 method)
2063     *         2400000.5       50123.2       (MJD method)
2064     *         2450123.5           0.2       (date &amp;time method)
2065     *</pre>
2066     *     The JD method is the most natural and convenient to use in
2067     *     cases where the loss of several decimal digits of resolution is
2068     *     acceptable.  The J2000 and MJD methods are good compromises
2069     *     between resolution and convenience.  In the case of uta,utb, the
2070     *     date &amp;time method is best matched to the Earth rotation angle
2071     *     algorithm used:  maximum precision is delivered when the uta
2072     *     argument is for 0hrs UT1 on the day in question and the utb
2073     *     argument lies in the range 0 to 1, or vice versa.
2074     *
2075     * <li> The Celestial Intermediate Pole coordinates are the x,y
2076     *     components of the unit vector in the Geocentric Celestial
2077     *     Reference System.
2078     *
2079     * <li> The arguments xp and yp are the coordinates (in radians) of the
2080     *     Celestial Intermediate Pole with respect to the International
2081     *     Terrestrial Reference System (see IERS Conventions 2003),
2082     *     measured along the meridians to 0 and 90 deg west respectively.
2083     *
2084     * <li> The matrix rc2t transforms from celestial to terrestrial
2085     *     coordinates:
2086     *
2087     *        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
2088     *
2089     *              = rc2t * [CRS]
2090     *
2091     *     where [CRS] is a vector in the Geocentric Celestial Reference
2092     *     System and [TRS] is a vector in the International Terrestrial
2093     *     Reference System (see IERS Conventions 2003), ERA is the Earth
2094     *     Rotation Angle and RPOM is the polar motion matrix.
2095     *
2096     * <li> Although its name does not include "00", This function is in fact
2097     *     specific to the IAU 2000 models.
2098     *</ol>
2099     *<p>Called:<ul>
2100     *     <li>{@link #jauC2ixy} celestial-to-intermediate matrix, given X,Y
2101     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
2102     *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
2103     *     <li>{@link #jauPom00} polar motion matrix
2104     *     <li>{@link #jauC2tcio} form CIO-based celestial-to-terrestrial matrix
2105     * </ul>
2106     * Reference:
2107     *
2108     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
2109     *     IERS Technical Note No. 32, BKG (2004)
2110     *
2111     *@version 2009 April 1
2112     *
2113     *  @since Release 20101201
2114     *
2115     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2116     */
2117     public static double[][] jauC2txy(double tta, double ttb, double uta, double utb,
2118                   double x, double y, double xp, double yp)
2119     {
2120        double rc2i[][] = new double[3][3], era, sp, rpom[][] = new double[3][3];
2121 
2122 
2123     /* Form the celestial-to-intermediate matrix for this TT. */
2124        rc2i = jauC2ixy(tta, ttb, x, y);
2125 
2126     /* Predict the Earth rotation angle for this UT1. */
2127        era = jauEra00(uta, utb);
2128 
2129     /* Estimate s'. */
2130        sp = jauSp00(tta, ttb);
2131 
2132     /* Form the polar motion matrix. */
2133        rpom = jauPom00(xp, yp, sp);
2134 
2135     /* Combine to form the celestial-to-terrestrial matrix. */
2136        double[][] rc2t = jauC2tcio(rc2i, era, rpom );
2137 
2138        return rc2t;
2139 
2140         }
2141     
2142     /**
2143     *  Gregorian Calendar to Julian Date.
2144     *
2145     *<p>This function is derived from the International Astronomical Union's
2146     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2147     *
2148     *<p>Status:  support function.
2149     *
2150     *<!-- Given: -->
2151     *     @param iy  int      year in Gregorian calendar (Note 1)
2152     *     @param im  int      month in Gregorian calendar (Note 1)
2153     *     @param id   int     day in Gregorian calendar (Note 1)
2154     *
2155     *<!-- Returned: -->
2156     *     @return d MJD zero-point: always 2400000.5
2157     *       <u>returned</u> Modified Julian Date for 0 hrs
2158     *
2159     * <!-- Returned (function value): -->
2160     *  @throws JSOFAIllegalParameter      status:
2161     *                           0 = OK
2162     *                          -1 = bad year   (Note 3: JD not computed)
2163     *                          -2 = bad month  (JD not computed)
2164     *                          -3 = bad day    (JD computed)
2165     *
2166     * <p>Notes:
2167     * <ol>
2168     *
2169     * <li> The algorithm used is valid from -4800 March 1, but this
2170     *     implementation rejects dates before -4799 January 1.
2171     *
2172     * <li> The Julian Date is returned in two pieces, in the usual JSOFA
2173     *     manner, which is designed to preserve time resolution.  The
2174     *     Julian Date is available as a single number by adding djm0 and
2175     *     djm.
2176     *
2177     * <li> In early eras the conversion is from the "Proleptic Gregorian
2178     *     Calendar";  no account is taken of the date(s) of adoption of
2179     *     the Gregorian Calendar, nor is the AD/BC numbering convention
2180     *     observed.
2181     *</ol>
2182     *<p>Reference:
2183     *
2184     *     <p>Explanatory Supplement to the Astronomical Almanac,
2185     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
2186     *     Section 12.92 (p604).
2187     *
2188     *@version 2009 October 19
2189     *
2190     *  @since Release 20101201
2191     *
2192     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2193     */
2194     public static JulianDate jauCal2jd(int iy, int im, int id) throws JSOFAIllegalParameter
2195     {
2196        int ly, my;
2197        long iypmy;
2198        double djm0, djm;
2199 
2200     /* Earliest year allowed (4800BC) */
2201        final int IYMIN = -4799;
2202 
2203     /* Month lengths in days */
2204        final int mtab[]
2205                          = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
2206 
2207 
2208     /* Validate year and month. */
2209        if (iy < IYMIN) throw new JSOFAIllegalParameter("bad year", -1);
2210        if (im < 1 || im > 12) throw new JSOFAIllegalParameter("bad month", -2);
2211 
2212     /* If February in a leap year, 1, otherwise 0. */
2213        ly = ((im == 2) &&(iy%4 == 0) && (iy%100 != 0 || (iy%400 == 0)))?1:0;
2214 
2215     /* Validate day, taking into account leap years. */
2216        if ( (id < 1) || (id > (mtab[im-1] + ly))) {
2217     }
2218 
2219     /* Return result. */
2220        my = (im - 14) / 12;
2221        iypmy = (long) (iy + my);
2222        djm0 = DJM0;
2223        djm = (double)((1461L * (iypmy + 4800L)) / 4L
2224                      + (367L * (long) (im - 2 - 12 * my)) / 12L
2225                      - (3L * ((iypmy + 4900L) / 100L)) / 4L
2226                      + (long) id - 2432076L);
2227 
2228     /* Return status. */
2229        return new JulianDate(djm0, djm);
2230 
2231         }
2232     
2233 
2234     /**
2235     *  Copy a p-vector.
2236     *
2237     *<p>This function is derived from the International Astronomical Union's
2238     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2239     *
2240     *<p>Status:  vector/matrix support function.
2241     *
2242     *<!-- Given: -->
2243     *     @param p         double[3]      p-vector to be copied
2244     *
2245     *<!-- Returned: -->
2246     *     @param c         double[3]       <u>given and returned</u> copy
2247     *     @return  double[3]       <u>given and returned</u> copy
2248     *
2249     *@version 2008 May 11
2250     *
2251     *  @since Release 20101201
2252     *
2253     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2254     */
2255     public static double[] jauCp(double p[], double c[])
2256     {
2257        
2258        c[0] = p[0];
2259        c[1] = p[1];
2260        c[2] = p[2];
2261 
2262        return c;
2263 
2264     }
2265     
2266 
2267     /**
2268     *  Copy a position/velocity vector.
2269     *
2270     *<p>This function is derived from the International Astronomical Union's
2271     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2272     *
2273     *<p>Status:  vector/matrix support function.
2274     *
2275     *<!-- Given: -->
2276     *     @param pv      double[2][3]     position/velocity vector to be copied
2277     *     @param c       double[2][3]      <u>returned</u> copy
2278     *
2279     *<!-- Returned: -->
2280     *     @return        double[2][3]      <u>returned c</u> copy
2281     *
2282     *<p>Called:<ul>
2283     *     <li>{@link #jauCp} copy p-vector
2284     * </ul>
2285     *@version 2008 May 11
2286     *
2287     *  @since Release 20101201
2288     *
2289     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2290     */
2291     public static double[][] jauCpv(double pv[][],  double c[][])
2292     {
2293 
2294         c[0]=jauCp(pv[0], c[0]);
2295         c[1]=jauCp(pv[1], c[1]);
2296 
2297        return c;
2298 
2299         }
2300     
2301 
2302     /**
2303     *  Copy an r-matrix.
2304     *
2305     *<p>This function is derived from the International Astronomical Union's
2306     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2307     *
2308     *<p>Status:  vector/matrix support function.
2309     *
2310     *<!-- Given: -->
2311     *     @param r         double[3][3]     r-matrix to be copied.
2312     *
2313     *<!-- Returned: -->
2314     *   @param c      double[3][3]      <u>given and returned</u> the elements of r are copied into this.
2315     *
2316     *<p>Called:<ul>
2317     *     <li>{@link #jauCp} copy p-vector
2318     * </ul>
2319     *@version 2008 May 11
2320     *
2321     *  @since Release 20101201
2322     *
2323     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2324     */
2325     public static void jauCr(double r[][], double c[][] )
2326     {
2327 
2328        jauCp(r[0], c[0]);
2329        jauCp(r[1], c[1]);
2330        jauCp(r[2], c[2]);
2331 
2332        return;
2333 
2334         }
2335     
2336 
2337     /**
2338     *  Decompose days to hours, minutes, seconds, fraction.
2339     *
2340     *<p>This function is derived from the International Astronomical Union's
2341     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2342     *
2343     *<p>Status:  vector/matrix support function.
2344     *
2345     *<!-- Given: -->
2346     *     @param ndp      int      resolution (Note 1)
2347     *     @param days     double   interval in days
2348     *
2349     *<!-- Returned: -->
2350     *     @param ihmsf    int[4]    <u>returned</u> hours, minutes, seconds, fraction
2351     *     @return sign     char      <u>returned</u> '+' or '-'
2352     *
2353     * <p>Notes:
2354     * <ol>
2355     *
2356     * <li> The argument ndp is interpreted as follows:
2357     *
2358     *     ndp         resolution
2359     *      :      ...0000 00 00
2360     *     -7         1000 00 00
2361     *     -6          100 00 00
2362     *     -5           10 00 00
2363     *     -4            1 00 00
2364     *     -3            0 10 00
2365     *     -2            0 01 00
2366     *     -1            0 00 10
2367     *      0            0 00 01
2368     *      1            0 00 00.1
2369     *      2            0 00 00.01
2370     *      3            0 00 00.001
2371     *      :            0 00 00.000...
2372     *
2373     * <li> The largest positive useful value for ndp is determined by the
2374     *     size of days, the format of double on the target platform, and
2375     *     the risk of overflowing ihmsf[3].  On a typical platform, for
2376     *     days up to 1.0, the available floating-point precision might
2377     *     correspond to ndp=12.  However, the practical limit is typically
2378     *     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
2379     *     only 16 bits.
2380     *
2381     * <li> The absolute value of days may exceed 1.0.  In cases where it
2382     *     does not, it is up to the caller to test for and handle the
2383     *     case where days is very nearly 1.0 and rounds up to 24 hours,
2384     *     by testing for ihms[0]=24 and setting ihmsf[0-3] to zero.
2385     *</ol>
2386     *@version 2008 May 11
2387     *
2388     *  @since Release 20101201
2389     *
2390     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2391     */
2392    public static char jauD2tf(final int ndp, final double days, int ihmsf[])
2393     {
2394        int nrs, n;
2395        double rs, rm, rh, a, w, ah, am, as, af;
2396 
2397 
2398     /* Handle sign. */
2399       char sign = (char) ( ( days >= 0.0 ) ? '+' : '-' );
2400 
2401     /* Interval in seconds. */
2402        a = DAYSEC * abs(days);
2403 
2404     /* Pre-round if resolution coarser than 1s (then pretend ndp=1). */
2405        if (ndp < 0) {
2406           nrs = 1;
2407           for (n = 1; n <= -ndp; n++) {
2408               nrs *= (n == 2 || n == 4) ? 6 : 10;
2409           }
2410           rs = (double) nrs;
2411           w = a / rs;
2412           a = rs * dnint(w);
2413        }
2414 
2415     /* Express the unit of each field in resolution units. */
2416        nrs = 1;
2417        for (n = 1; n <= ndp; n++) {
2418           nrs *= 10;
2419        }
2420        rs = (double) nrs;
2421        rm = rs * 60.0;
2422        rh = rm * 60.0;
2423 
2424     /* Round the interval and express in resolution units. */
2425        a = dnint(rs * a);
2426 
2427     /* Break into fields. */
2428        ah = a / rh;
2429        ah = dint(ah);
2430        a -= ah * rh;
2431        am = a / rm;
2432        am = dint(am);
2433        a -= am * rm;
2434        as = a / rs;
2435        as = dint(as);
2436        af = a - as * rs;
2437 
2438     /* Return results. */
2439        ihmsf[0] = (int) ah;
2440        ihmsf[1] = (int) am;
2441        ihmsf[2] = (int) as;
2442        ihmsf[3] = (int) af;
2443 
2444        return sign;
2445 
2446         }
2447  
2448    /**
2449     * Representation of Gregorian Calendar with fractional day.
2450     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2451     * 
2452     * @since AIDA Stage 1
2453     */
2454    public static class Calendar {
2455        public final int iy;
2456        public final int im;
2457        public final int id;
2458        public final double fd;
2459        public Calendar (int iy, int im, int id, double fd)
2460        {
2461            this.iy = iy;
2462            this.im = im;
2463            this.id = id;
2464            this.fd = fd;
2465        }
2466    }
2467 
2468    /**
2469     * Representation of Gregorian Calendar with integer hours minutes and seconds.
2470     * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
2471     * 
2472     * @since AIDA Stage 1
2473     */
2474    public static class CalendarHMS {
2475        public final int iy;
2476        public final int im;
2477        public final int id;
2478        public final int ihmsf[];
2479        public CalendarHMS (int iy, int im, int id, int hmsf[]){
2480            this.iy = iy;
2481            this.im = im;
2482            this.id = id;
2483            this.ihmsf = hmsf;
2484        }
2485    }
2486    
2487 /**
2488 *
2489 *  Format for output a 2-part Julian Date (or in the case of UTC a
2490 *  quasi-JD form that includes special provision for leap seconds).
2491 *
2492 *<p>This function is derived from the International Astronomical Union's
2493 *  SOFA (Standards of Fundamental Astronomy) software collection.
2494 *
2495 *<p>Status:  support function.
2496 *
2497 *<!-- Given: -->
2498 *     @param scale     char[]  time scale ID (Note 1)
2499 *     @param ndp       int     resolution (Note 2)
2500 *     @param d1     double  time as a 2-part Julian Date (Notes 3,4)
2501 *     @param d2     double  time as a 2-part Julian Date (Notes 3,4)
2502 *
2503 *<!-- Returned:-->
2504 *     iy,im,id  int     year, month, day in Gregorian calendar (Note 5)
2505 *     ihmsf     int[4]  hours, minutes, seconds, fraction (Note 1)
2506 *
2507 *  Returned (function value):
2508 *               int     status: +1 = dubious year (Note 5)
2509 *                                0 = OK
2510 *                               -1 = unacceptable date (Note 6)
2511 *
2512 *<p>Notes:
2513 *<ol>
2514 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2515 *     case) is significant, and enables handling of leap seconds (see
2516 *     Note 4).
2517 *
2518 * <li> ndp is the number of decimal places in the seconds field, and can
2519 *     have negative as well as positive values, such as:
2520 *
2521 *     ndp         resolution
2522 *     -4            1 00 00
2523 *     -3            0 10 00
2524 *     -2            0 01 00
2525 *     -1            0 00 10
2526 *      0            0 00 01
2527 *      1            0 00 00.1
2528 *      2            0 00 00.01
2529 *      3            0 00 00.001
2530 *
2531 *     The limits are platform dependent, but a safe range is -5 to +9.
2532 *
2533 * <li> d1+d2 is Julian Date, apportioned in any convenient way between
2534 *     the two arguments, for example where d1 is the Julian Day Number
2535 *     and d2 is the fraction of a day.  In the case of UTC, where the
2536 *     use of JD is problematical, special conventions apply:  see the
2537 *     next note.
2538 *
2539 * <li> JD cannot unambiguously represent UTC during a leap second unless
2540 *     special measures are taken.  The SOFA internal convention is that
2541 *     the quasi-JD day represents UTC days whether the length is 86399,
2542 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2543 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2544 *     expression was changed, and these "mini-leaps" are also included
2545 *     in the SOFA convention.
2546 *
2547 * <li> The warning status "dubious year" flags UTCs that predate the
2548 *     introduction of the time scale or that are too far in the future
2549 *     to be trusted.  See iauDat for further details.
2550 *
2551 * <li> For calendar conventions and limitations, see iauCal2jd.
2552 *</ol>
2553 *  Called:
2554 *     iauJd2cal    JD to Gregorian calendar
2555 *     iauD2tf      decompose days to hms
2556 *     iauDat       delta(AT) = TAI-UTC
2557 *
2558 *@version 2014 February 15
2559 *
2560 *@since JSOFA release 20131202
2561 *
2562 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2563  * @throws JSOFAInternalError an internal error has occured
2564  * @throws JSOFAIllegalParameter 
2565 */
2566 public static CalendarHMS jauD2dtf(final String scale, int ndp, double d1, double d2 ) throws JSOFAIllegalParameter, JSOFAInternalError
2567 {
2568  boolean leap;
2569  int iy1, im1, id1, iy2, im2, id2, ihmsf1[] = new int[4];
2570  double a1, b1, fd, dat0, dat12, dat24, dleap;
2571 
2572 
2573 /* The two-part JD. */
2574  a1 = d1;
2575  b1 = d2;
2576 
2577 /* Provisional calendar date. */
2578  Calendar cal = jauJd2cal(a1, b1);
2579  iy1 = cal.iy;
2580  im1 = cal.im;
2581  id1 = cal.id;
2582  fd = cal.fd;
2583 
2584 /* Is this a leap second day? */
2585  leap = false;
2586  if ( scale.equalsIgnoreCase("UTC") ) {
2587 
2588  /* TAI-UTC at 0h today. */
2589      dat0 = jauDat(iy1, im1, id1, 0.0 );
2590 
2591  /* TAI-UTC at 12h today (to detect drift). */
2592      dat12 = jauDat(iy1, im1, id1, 0.5);
2593 
2594  /* TAI-UTC at 0h tomorrow (to detect jumps). */
2595     cal = jauJd2cal(a1+1.5, b1-fd);
2596     iy2 = cal.iy;
2597     im2 = cal.im;
2598     id2 = cal.id;
2599     dat24 = jauDat(iy2, im2, id2, 0.0);
2600 
2601  /* Any sudden change in TAI-UTC (seconds). */
2602     dleap = dat24 - (2.0*dat12 - dat0);
2603 
2604  /* If leap second day, scale the fraction of a day into SI. */
2605     leap = (dleap != 0.0);
2606     if (leap) fd += fd * dleap/DAYSEC;
2607  }
2608 
2609 jauD2tf ( ndp, fd, ihmsf1 );
2610 
2611 /* Has the (rounded) time gone past 24h? */
2612  if ( ihmsf1[0] > 23 ) {
2613 
2614  /* Yes.  We probably need tomorrow's calendar date. */
2615     cal = jauJd2cal(a1+1.5, b1-fd);
2616     iy2 = cal.iy; im2 = cal.im; id2 = cal.id; 
2617     
2618  /* Is today a leap second day? */
2619     if ( ! leap ) {
2620 
2621     /* No.  Use 0h tomorrow. */
2622        iy1 = iy2;
2623        im1 = im2;
2624        id1 = id2;
2625        ihmsf1[0] = 0;
2626        ihmsf1[1] = 0;
2627        ihmsf1[2] = 0;
2628 
2629     } else {
2630 
2631     /* Yes.  Are we past the leap second itself? */
2632        if ( ihmsf1[2] > 0 ) {
2633 
2634        /* Yes.  Use tomorrow but allow for the leap second. */
2635           iy1 = iy2;
2636           im1 = im2;
2637           id1 = id2;
2638           ihmsf1[0] = 0;
2639           ihmsf1[1] = 0;
2640           ihmsf1[2] = 0;
2641 
2642        } else {
2643 
2644        /* No.  Use 23 59 60... today. */
2645           ihmsf1[0] = 23;
2646           ihmsf1[1] = 59;
2647           ihmsf1[2] = 60;
2648        }
2649 
2650     /* If rounding to 10s or coarser always go up to new day. */
2651        if ( ndp < 0 && ihmsf1[2] == 60 ) {
2652           iy1 = iy2;
2653           im1 = im2;
2654           id1 = id2;
2655           ihmsf1[0] = 0;
2656           ihmsf1[1] = 0;
2657           ihmsf1[2] = 0;
2658        }
2659     }
2660  }
2661 
2662 /* Results. */
2663  
2664  return new CalendarHMS(iy1, im1, id1, ihmsf1);
2665 
2666 }   
2667 
2668 /**
2669 *  Encode date and time fields into 2-part Julian Date (or in the case
2670 *  of UTC a quasi-JD form that includes special provision for leap
2671 *  seconds).
2672 *
2673 *<p>This function is derived from the International Astronomical Union's
2674 *  SOFA (Standards of Fundamental Astronomy) software collection.
2675 *
2676 *  <p>Status:  support function.
2677 *
2678 * <!-- Given: -->
2679 *    @param scale     char  time scale ID (Note 1)
2680 *    @param iy  int     year in Gregorian calendar (Note 2)
2681 *    @param im   int    month in Gregorian calendar (Note 2)
2682 *    @param id  int      day in Gregorian calendar (Note 2)
2683 *    @param ihr  int     hour
2684 *    @param imn   int    minute
2685 *    @param sec       double  seconds
2686 *
2687 * <!-- Returned: -->
2688 *     @return     2-part Julian Date (Notes 3,4)
2689 *
2690  * @throws JSOFAIllegalParameter 
2691  * 
2692 * @throws JSOFAInternalError          {@code    status: +3 = both of next two
2693 *                               +2 = time is after end of day (Note 5)
2694 *                               +1 = dubious year (Note 6)
2695 *                                0 = OK
2696 *                               -1 = bad year
2697 *                               -2 = bad month
2698 *                               -3 = bad day
2699 *                               -4 = bad hour
2700 *                               -5 = bad minute
2701 *                               -6 = bad second (<0)}
2702 *
2703 *<p>Notes:
2704 *<ol>
2705 * <li> scale identifies the time scale.  Only the value "UTC" (in upper
2706 *     case) is significant, and enables handling of leap seconds (see
2707 *     Note 4).
2708 *
2709 * <li> For calendar conventions and limitations, see iauCal2jd.
2710 *
2711 * <li> The sum of the results, d1+d2, is Julian Date, where normally d1
2712 *     is the Julian Day Number and d2 is the fraction of a day.  In the
2713 *     case of UTC, where the use of JD is problematical, special
2714 *     conventions apply:  see the next note.
2715 *
2716 * <li> JD cannot unambiguously represent UTC during a leap second unless
2717 *     special measures are taken.  The SOFA internal convention is that
2718 *     the quasi-JD day represents UTC days whether the length is 86399,
2719 *     86400 or 86401 SI seconds.  In the 1960-1972 era there were
2720 *     smaller jumps (in either direction) each time the linear UTC(TAI)
2721 *     expression was changed, and these "mini-leaps" are also included
2722 *     in the SOFA convention.
2723 *
2724 * <li> The warning status "time is after end of day" usually means that
2725 *     the sec argument is greater than 60.0.  However, in a day ending
2726 *     in a leap second the limit changes to 61.0 (or 59.0 in the case
2727 *     of a negative leap second).
2728 *
2729 * <li> The warning status "dubious year" flags UTCs that predate the
2730 *     introduction of the time scale or that are too far in the future
2731 *     to be trusted.  See iauDat for further details.
2732 *
2733 * <li> Only in the case of continuous and regular time scales (TAI, TT,
2734 *     TCG, TCB and TDB) is the result d1+d2 a Julian Date, strictly
2735 *     speaking.  In the other cases (UT1 and UTC) the result must be
2736 *     used with circumspection;  in particular the difference between
2737 *     two such results cannot be interpreted as a precise time
2738 *     interval.
2739 *</ol>
2740 *  Called:
2741 *     iauCal2jd    Gregorian calendar to JD
2742 *     iauDat       delta(AT) = TAI-UTC
2743 *     iauJd2cal    JD to Gregorian calendar
2744 *
2745 *@version 2013 July 26
2746 *
2747 *@since JSOFA release 20131202
2748 *
2749 *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
2750 */
2751 public static JulianDate jauDtf2d(final String scale, int iy, int im, int id,
2752         int ihr, int imn, double sec) throws JSOFAIllegalParameter, JSOFAInternalError
2753 {
2754 int js = 0, iy2, im2, id2;
2755 double dj, w, day, seclim, dat0, dat12, dat24, dleap, time;
2756 
2757 
2758 /* Today's Julian Day Number. */
2759 JulianDate jd = jauCal2jd(iy, im, id);
2760 dj = jd.djm0; w = jd.djm1;
2761 dj += w;
2762 
2763 /* Day length and final minute length in seconds (provisional). */
2764 day = DAYSEC;
2765 seclim = 60.0;
2766 
2767 /* Deal with the UTC leap second case. */
2768 if (  scale.equals("UTC") ) {
2769 
2770 /* TAI-UTC at 0h today. */
2771     dat0 = jauDat(iy, im, id, 0.0);
2772 
2773 /* TAI-UTC at 12h today (to detect drift). */
2774     dat12 = jauDat(iy, im, id, 0.5);
2775 
2776 /* TAI-UTC at 0h tomorrow (to detect jumps). */
2777  Calendar cal = jauJd2cal ( dj, 1.5);
2778  iy2 = cal.iy; im2 = cal.im; id2 = cal.id; w = cal.fd;
2779  
2780  dat24 = jauDat(iy2, im2, id2, 0.0);
2781 
2782 /* Any sudden change in TAI-UTC between today and tomorrow. */
2783  dleap = dat24 - (2.0*dat12 - dat0);
2784 
2785 /* If leap second day, correct the day and final minute lengths. */
2786  day += dleap;
2787  if ( ihr == 23 && imn == 59 ) seclim += dleap;
2788 
2789 /* End of UTC-specific actions. */
2790 }
2791 
2792 /* Validate the time. */
2793 if ( ihr >= 0 && ihr <= 23 ) {
2794  if ( imn >= 0 && imn <= 59 ) {
2795     if ( sec >= 0 ) {
2796        if ( sec >= seclim ) {
2797           js += 2;
2798        }
2799     } else {
2800        js = -6;
2801     }
2802  } else {
2803     js = -5;
2804  }
2805 } else {
2806  js = -4;
2807 }
2808 if ( js < 0 ) throw new JSOFAInternalError("problem with time", js);
2809 
2810 /* The time in days. */
2811 time  = ( 60.0 * ( (double) ( 60 * ihr + imn ) ) + sec ) / day;
2812 
2813 /* Return the date and time. */
2814 return new JulianDate(dj, time) ;
2815 
2816 }
2817 
2818 /**
2819  * the date of the last leap second. Note that this is not a SOFA standard fumction.
2820  * @return the {@link JulianDate} of the last leap second.
2821  */
2822 public static JulianDate lastLeapSecondDate()
2823 {
2824     final LeapInfo lastentry = leapSeconds[leapSeconds.length -1];
2825     JulianDate retval = new JulianDate(0, 0);
2826     try {
2827         retval = jauCal2jd(lastentry.iyear,lastentry.month,1);
2828     } catch (JSOFAIllegalParameter e) {
2829         //should not happen
2830          e.printStackTrace();
2831     }
2832     return retval;
2833     
2834 }
2835  
2836 
2837     /**
2838     *  For a given UTC date, calculate delta(AT) = TAI-UTC.
2839     *<pre>
2840     *     :------------------------------------------:
2841     *     :                                          :
2842     *     :                 IMPORTANT                :
2843     *     :                                          :
2844     *     :  A new version of this function must be  :
2845     *     :  produced whenever a new leap second is  :
2846     *     :  announced.  There are four items to     :
2847     *     :  change on each such occasion:           :
2848     *     :                                          :
2849     *     :  1) A new line must be added to the set  :
2850     *     :     of statements that initialize the    :
2851     *     :     array "changes".                     :
2852     *     :                                          :
2853     *     :  2) The parameter IYV must be set to     :
2854     *     :     the current year.                    :
2855     *     :                                          :
2856     *     :  3) The "Latest leap second" comment     :
2857     *     :     below must be set to the new leap    :
2858     *     :     second date.                         :
2859     *     :                                          :
2860     *     :  4) The "This revision" comment, later,  :
2861     *     :     must be set to the current date.     :
2862     *     :                                          :
2863     *     :  Change (2) must also be carried out     :
2864     *     :  whenever the function is re-issued,     :
2865     *     :  even if no leap seconds have been       :
2866     *     :  added.                                  :
2867     *     :                                          :
2868     *     :  Latest leap second:  2017 Jan 01        :
2869     *     :                                          :
2870     *     :__________________________________________:
2871     *</pre>
2872     *<p>This function is derived from the International Astronomical Union's
2873     *  SOFA (Standards Of Fundamental Astronomy) software collection.
2874     *
2875     *<p>Status:  support function.
2876     *
2877     *<!-- Given: -->
2878     *     @param iy      int       UTC:  year (Notes 1 and 2)
2879     *     @param im      int             month (Note 2)
2880     *     @param id      int             day (Notes 2 and 3)
2881     *     @param fd      double          fraction of day (Note 4)
2882     *
2883     *<!-- Returned: -->
2884     *     @return deltat  double     <u>returned</u> TAI minus UTC, seconds
2885     *
2886     *  @throws     JSOFAIllegalParameter   status (Note 5):
2887     *                       1 = dubious year (Note 1)
2888     *                       0 = OK
2889     *                      -1 = bad year
2890     *                      -2 = bad month
2891     *                      -3 = bad day (Note 3)
2892     *                      -4 = bad fraction (Note 4)
2893     *
2894     * <p>Notes:
2895     * <ol>
2896     *
2897     * <li> UTC began at 1960 January 1.0 (JD 2436934.5) and it is improper
2898     *     to call the function with an earlier date.  If this is attempted,
2899     *     zero is returned together with a warning status.
2900     *
2901     *     Because leap seconds cannot, in principle, be predicted in
2902     *     advance, a reliable check for dates beyond the valid range is
2903     *     impossible.  To guard against gross errors, a year five or more
2904     *     after the release year of the present function (see parameter
2905     *     IYV) is considered dubious.  In this case a warning status is
2906     *     returned but the result is computed in the normal way.
2907     *
2908     *     For both too-early and too-late years, the warning status is
2909     *     j=+1.  This is distinct from the error status j=-1, which
2910     *     signifies a year so early that JD could not be computed.
2911     *
2912     * <li> If the specified date is for a day which ends with a leap second,
2913     *     the TAI-UTC value returned is for the period leading up to the
2914     *     leap second.  If the date is for a day which begins as a leap
2915     *     second ends, the TAI-UTC returned is for the period following the
2916     *     leap second.
2917     *
2918     * <li> The day number must be in the normal calendar range, for example
2919     *     1 through 30 for April.  The "almanac" convention of allowing
2920     *     such dates as January 0 and December 32 is not supported in this
2921     *     function, in order to avoid confusion near leap seconds.
2922     *
2923     * <li> The fraction of day is used only for dates before the
2924     *     introduction of leap seconds, the first of which occurred at the
2925     *     end of 1971.  It is tested for validity (zero to less than 1 is
2926     *     the valid range) even if not used;  if invalid, zero is used and
2927     *     status j=-4 is returned.  For many applications, setting fd to
2928     *     zero is acceptable;  the resulting error is always less than 3 ms
2929     *     (and occurs only pre-1972).
2930     *
2931     * <li> The status value returned in the case where there are multiple
2932     *     errors refers to the first error detected.  For example, if the
2933     *     month and day are 13 and 32 respectively, j=-2 (bad month)
2934     *     will be returned.
2935     *
2936     * <li> In cases where a valid result is not available, zero is returned.
2937     *
2938     *<p>References:
2939     *
2940     * <li> For dates from 1961 January 1 onwards, the expressions from the
2941     *     file ftp://maia.usno.navy.mil/ser7/tai-utc.dat are used.
2942     *
2943     * <li> The 5ms timestep at 1961 January 1 is taken from 2.58.1 (p87) of
2944     *     the 1992 Explanatory Supplement.
2945     *</ol>
2946     *<p>Called:<ul>
2947     *     <li>{@link #jauCal2jd} Gregorian calendar to Julian Day number
2948     * </ul>
2949     *<p>@version 20160729
2950     *
2951     *  @since Release 20101201
2952     *
2953     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
2954     */
2955     public static double jauDat(int iy, int im, int id, double fd ) throws JSOFAIllegalParameter, JSOFAInternalError
2956     {
2957 
2958     /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
2959       final double drift[][] = {
2960           { 37300.0, 0.0012960 },
2961           { 37300.0, 0.0012960 },
2962           { 37300.0, 0.0012960 },
2963           { 37665.0, 0.0011232 },
2964           { 37665.0, 0.0011232 },
2965           { 38761.0, 0.0012960 },
2966           { 38761.0, 0.0012960 },
2967           { 38761.0, 0.0012960 },
2968           { 38761.0, 0.0012960 },
2969           { 38761.0, 0.0012960 },
2970           { 38761.0, 0.0012960 },
2971           { 38761.0, 0.0012960 },
2972           { 39126.0, 0.0025920 },
2973           { 39126.0, 0.0025920 }
2974        };
2975 
2976     /* Number of Delta(AT) expressions before leap seconds were introduced */
2977     final int NERA1 = drift.length;
2978 
2979 
2980     /* Number of Delta(AT) changes */
2981        final int NDAT = leapSeconds.length;
2982 
2983     /* Miscellaneous local variables */
2984        int i, m;
2985        double da, djm;
2986 
2987 
2988     /* Initialize the result to zero. */
2989        double deltat = da = 0.0;
2990 
2991     /* If invalid fraction of a day, set error status and give up. */
2992        if (fd < 0.0 || fd > 1.0) throw new JSOFAIllegalParameter("bad day fraction", -4);
2993 
2994     /* Convert the date into an MJD. */
2995        JulianDate jd = jauCal2jd(iy, im, id);
2996        djm = jd.djm1;
2997 
2998     /* If pre-UTC year, set warning status and give up. */
2999        if (iy < leapSeconds[0].iyear) throw new JSOFAInternalError("year before UTC start", 1);
3000 
3001     /* If suspiciously late year, set warning status but proceed. */
3002        if (iy > IYV + 5) {
3003     }
3004 
3005     /* Combine year and month to form a date-ordered integer... */
3006        m = 12*iy + im;
3007 
3008     /* ...and use it to find the preceding table entry. */
3009        for (i = NDAT-1; i >=0; i--) {
3010           if (m >= (12 * leapSeconds[i].iyear + leapSeconds[i].month)) break;
3011        }
3012 
3013     /* Get the Delta(AT). */
3014        da = leapSeconds[i].delat;
3015 
3016     /* If pre-1972, adjust for drift. */
3017        if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];
3018 
3019     /* Return the Delta(AT) value. */
3020        deltat = da;
3021 
3022     /* Return the value. */
3023        return deltat;
3024 
3025         }
3026     
3027 
3028     /**
3029     *  An approximation to TDB-TT, the difference between barycentric
3030     *  dynamical time and terrestrial time, for an observer on the Earth.
3031     *
3032     *  The different time scales - proper, coordinate and realized - are
3033     *  related to each other:
3034     *  {@code
3035     *            TAI             <-  physically realized
3036     *             :
3037     *          offset            <-  observed (nominally +32.184s)
3038     *             :
3039     *            TT              <-  terrestrial time
3040     *             :
3041     *    rate adjustment (L_G)   <-  definition of TT
3042     *             :
3043     *            TCG             <-  time scale for GCRS
3044     *             :
3045     *      "periodic" terms      <-  jauDtdb  is an implementation
3046     *             :
3047     *    rate adjustment (L_C)   <-  function of solar-system ephemeris
3048     *             :
3049     *            TCB             <-  time scale for BCRS
3050     *             :
3051     *    rate adjustment (-L_B)  <-  definition of TDB
3052     *             :
3053     *            TDB             <-  TCB scaled to track TT
3054     *             :
3055     *      "periodic" terms      <-  -jau_DTDB is an approximation
3056     *             :
3057     *            TT              <-  terrestrial time
3058     *}
3059     *  Adopted values for the various constants can be found in the IERS
3060     *  Conventions (McCarthy &amp; Petit 2003).
3061     *
3062     *<p>This function is derived from the International Astronomical Union's
3063     *  SOFA (Standards Of Fundamental Astronomy) software collection.
3064     *
3065     *<p>Status:  canonical model.
3066     *
3067     *<!-- Given: -->
3068     *     @param date1 double   date, TDB (Notes 1-3)
3069     *     @param date2 double   date, TDB (Notes 1-3) 
3070     *     @param ut             double   universal time (UT1, fraction of one day)
3071     *     @param elong          double   longitude (east positive, radians)
3072     *     @param u              double   distance from Earth spin axis (km)
3073     *     @param v              double   distance north of equatorial plane (km)
3074     *
3075     * <!-- Returned (function value): -->
3076     *  @return @return             double  TDB-TT (seconds)
3077     *
3078     * <p>Notes:
3079     * <ol>
3080     *
3081     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
3082     *     convenient way between the two arguments.  For example,
3083     *     JD(TT)=2450123.7 could be expressed in any of these ways,
3084     *     among others:
3085     *<pre>
3086     *            date1          date2
3087     *
3088     *         2450123.7           0.0       (JD method)
3089     *         2451545.0       -1421.3       (J2000 method)
3090     *         2400000.5       50123.2       (MJD method)
3091     *         2450123.5           0.2       (date &amp; time method)
3092     *</pre>
3093     *     The JD method is the most natural and convenient to use in
3094     *     cases where the loss of several decimal digits of resolution
3095     *     is acceptable.  The J2000 method is best matched to the way
3096     *     the argument is handled internally and will deliver the
3097     *     optimum resolution.  The MJD method and the date &amp; time methods
3098     *     are both good compromises between resolution and convenience.
3099     *
3100     *     Although the date is, formally, barycentric dynamical time (TDB),
3101     *     the terrestrial dynamical time (TT) can be used with no practical
3102     *     effect on the accuracy of the prediction.
3103     *
3104     * <li> TT can be regarded as a coordinate time that is realized as an
3105     *     offset of 32.184s from International Atomic Time, TAI.  TT is a
3106     *     specific linear transformation of geocentric coordinate time TCG,
3107     *     which is the time scale for the Geocentric Celestial Reference
3108     *     System, GCRS.
3109     *
3110     * <li> TDB is a coordinate time, and is a specific linear transformation
3111     *     of barycentric coordinate time TCB, which is the time scale for
3112     *     the Barycentric Celestial Reference System, BCRS.
3113     *
3114     * <li> The difference TCG-TCB depends on the masses and positions of the
3115     *     bodies of the solar system and the velocity of the Earth.  It is
3116     *     dominated by a rate difference, the residual being of a periodic
3117     *     character.  The latter, which is modeled by the present function,
3118     *     comprises a main (annual) sinusoidal term of amplitude
3119     *     approximately 0.00166 seconds, plus planetary terms up to about
3120     *     20 microseconds, and lunar and diurnal terms up to 2 microseconds.
3121     *     These effects come from the changing transverse Doppler effect
3122     *     and gravitational red-shift as the observer (on the Earth's
3123     *     surface) experiences variations in speed (with respect to the
3124     *     BCRS) and gravitational potential.
3125     *
3126     * <li> TDB can be regarded as the same as TCB but with a rate adjustment
3127     *     to keep it close to TT, which is convenient for many applications.
3128     *     The history of successive attempts to define TDB is set out in
3129     *     Resolution 3 adopted by the IAU General Assembly in 2006, which
3130     *     defines a fixed TDB(TCB) transformation that is consistent with
3131     *     contemporary solar-system ephemerides.  Future ephemerides will
3132     *     imply slightly changed transformations between TCG and TCB, which
3133     *     could introduce a linear drift between TDB and TT;  however, any
3134     *     such drift is unlikely to exceed 1 nanosecond per century.
3135     *
3136     * <li> The geocentric TDB-TT model used in the present function is that of
3137     *     Fairhead &amp; Bretagnon (1990), in its full form.  It was originally
3138     *     supplied by Fairhead (private communications with P.T.Wallace,
3139     *     1990) as a Fortran subroutine.  The present C function contains an
3140     *     adaptation of the Fairhead code.  The numerical results are
3141     *     essentially unaffected by the changes, the differences with
3142     *     respect to the Fairhead &amp; Bretagnon original being at the 1e-20 s
3143     *     level.
3144     *
3145     *     The topocentric part of the model is from Moyer (1981) and
3146     *     Murray (1983), with fundamental arguments adapted from
3147     *     Simon et al. 1994.  It is an approximation to the expression
3148     *     ( v / c ) . ( r / c ), where v is the barycentric velocity of
3149     *     the Earth, r is the geocentric position of the observer and
3150     *     c is the speed of light.
3151     *
3152     *     By supplying zeroes for u and v, the topocentric part of the
3153     *     model can be nullified, and the function will return the Fairhead
3154     *     &amp; Bretagnon result alone.
3155     *
3156     * <li> During the interval 1950-2050, the absolute accuracy is better
3157     *     than +/- 3 nanoseconds relative to time ephemerides obtained by
3158     *     direct numerical integrations based on the JPL DE405 solar system
3159     *     ephemeris.
3160     *
3161     * <li> It must be stressed that the present function is merely a model,
3162     *     and that numerical integration of solar-system ephemerides is the
3163     *     definitive method for predicting the relationship between TCG and
3164     *     TCB and hence between TT and TDB.
3165     *</ol>
3166     *<p>References:
3167     *
3168     *     <p>Fairhead, L., &amp; Bretagnon, P., Astron.Astrophys., 229, 240-247
3169     *     (1990).
3170     *
3171     *     <p>IAU 2006 Resolution 3.
3172     *
3173     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
3174     *     IERS Technical Note No. 32, BKG (2004)
3175     *
3176     *     <p>Moyer, T.D., Cel.Mech., 23, 33 (1981).
3177     *
3178     *     <p>Murray, C.A., Vectorial Astrometry, Adam Hilger (1983).
3179     *
3180     *     <p>Seidelmann, P.K. et al., Explanatory Supplement to the
3181     *     Astronomical Almanac, Chapter 2, University Science Books (1992).
3182     *
3183     *     <p>Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
3184     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 282, 663-683 (1994).
3185     *
3186     *@version 2009 December 17
3187     *
3188     *  @since Release 20101201
3189     *
3190     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
3191     */
3192     public static  double jauDtdb(double date1, double date2,
3193                    double ut, double elong, double u, double v)
3194     {
3195        double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4,
3196               wf, wj;
3197        int j;
3198 
3199     /*
3200     * =====================
3201     * Fairhead et al. model
3202     * =====================
3203     *
3204     * 787 sets of three coefficients.
3205     *
3206     * Each set is
3207     *    amplitude (microseconds)
3208     *      frequency (radians per Julian millennium since J2000.0)
3209     *      phase (radians)
3210     *
3211     * Sets   1-474 are the T**0 terms
3212     *  "   475-679  "   "  T**1
3213     *  "   680-764  "   "  T**2
3214     *  "   765-784  "   "  T**3
3215     *  "   785-787  "   "  T**4
3216     */
3217 
3218        final double fairhd[][] = {
3219        /* 1, 10 */
3220           { 1656.674564e-6,     6283.075849991,  6.240054195 },
3221           {   22.417471e-6,     5753.384884897,  4.296977442 },
3222           {   13.839792e-6,    12566.151699983,  6.196904410 },
3223           {    4.770086e-6,      529.690965095,  0.444401603 },
3224           {    4.676740e-6,     6069.776754553,  4.021195093 },
3225           {    2.256707e-6,      213.299095438,  5.543113262 },
3226           {    1.694205e-6,      -3.523118349,   5.025132748 },
3227           {    1.554905e-6,    77713.771467920,  5.198467090 },
3228           {    1.276839e-6,     7860.419392439,  5.988822341 },
3229           {    1.193379e-6,     5223.693919802,  3.649823730 },
3230        /* 11, 20 */
3231           {    1.115322e-6,     3930.209696220,  1.422745069 },
3232           {    0.794185e-6,    11506.769769794,  2.322313077 },
3233           {    0.447061e-6,       26.298319800,  3.615796498 },
3234           {    0.435206e-6,     -398.149003408,  4.349338347 },
3235           {    0.600309e-6,     1577.343542448,  2.678271909 },
3236           {    0.496817e-6,     6208.294251424,  5.696701824 },
3237           {    0.486306e-6,     5884.926846583,  0.520007179 },
3238           {    0.432392e-6,       74.781598567,  2.435898309 },
3239           {    0.468597e-6,     6244.942814354,  5.866398759 },
3240           {    0.375510e-6,     5507.553238667,  4.103476804 },
3241        /* 21, 30 */
3242           {    0.243085e-6,     -775.522611324,  3.651837925 },
3243           {    0.173435e-6,    18849.227549974,  6.153743485 },
3244           {    0.230685e-6,     5856.477659115,  4.773852582 },
3245           {    0.203747e-6,    12036.460734888,  4.333987818 },
3246           {    0.143935e-6,     -796.298006816,  5.957517795 },
3247           {    0.159080e-6,    10977.078804699,  1.890075226 },
3248           {    0.119979e-6,       38.133035638,  4.551585768 },
3249           {    0.118971e-6,     5486.777843175,  1.914547226 },
3250           {    0.116120e-6,     1059.381930189,  0.873504123 },
3251           {    0.137927e-6,    11790.629088659,  1.135934669 },
3252        /* 31, 40 */
3253           {    0.098358e-6,     2544.314419883,  0.092793886 },
3254           {    0.101868e-6,    -5573.142801634,  5.984503847 },
3255           {    0.080164e-6,      206.185548437,  2.095377709 },
3256           {    0.079645e-6,     4694.002954708,  2.949233637 },
3257           {    0.062617e-6,       20.775395492,  2.654394814 },
3258           {    0.075019e-6,     2942.463423292,  4.980931759 },
3259           {    0.064397e-6,     5746.271337896,  1.280308748 },
3260           {    0.063814e-6,     5760.498431898,  4.167901731 },
3261           {    0.048042e-6,     2146.165416475,  1.495846011 },
3262           {    0.048373e-6,      155.420399434,  2.251573730 },
3263        /* 41, 50 */
3264           {    0.058844e-6,      426.598190876,  4.839650148 },
3265           {    0.046551e-6,       -0.980321068,  0.921573539 },
3266           {    0.054139e-6,    17260.154654690,  3.411091093 },
3267           {    0.042411e-6,     6275.962302991,  2.869567043 },
3268           {    0.040184e-6,       -7.113547001,  3.565975565 },
3269           {    0.036564e-6,     5088.628839767,  3.324679049 },
3270           {    0.040759e-6,    12352.852604545,  3.981496998 },
3271           {    0.036507e-6,      801.820931124,  6.248866009 },
3272           {    0.036955e-6,     3154.687084896,  5.071801441 },
3273           {    0.042732e-6,      632.783739313,  5.720622217 },
3274        /* 51, 60 */
3275           {    0.042560e-6,   161000.685737473,  1.270837679 },
3276           {    0.040480e-6,    15720.838784878,  2.546610123 },
3277           {    0.028244e-6,    -6286.598968340,  5.069663519 },
3278           {    0.033477e-6,     6062.663207553,  4.144987272 },
3279           {    0.034867e-6,      522.577418094,  5.210064075 },
3280           {    0.032438e-6,     6076.890301554,  0.749317412 },
3281           {    0.030215e-6,     7084.896781115,  3.389610345 },
3282           {    0.029247e-6,   -71430.695617928,  4.183178762 },
3283           {    0.033529e-6,     9437.762934887,  2.404714239 },
3284           {    0.032423e-6,     8827.390269875,  5.541473556 },
3285        /* 61, 70 */
3286           {    0.027567e-6,     6279.552731642,  5.040846034 },
3287           {    0.029862e-6,    12139.553509107,  1.770181024 },
3288           {    0.022509e-6,    10447.387839604,  1.460726241 },
3289           {    0.020937e-6,     8429.241266467,  0.652303414 },
3290           {    0.020322e-6,      419.484643875,  3.735430632 },
3291           {    0.024816e-6,    -1194.447010225,  1.087136918 },
3292           {    0.025196e-6,     1748.016413067,  2.901883301 },
3293           {    0.021691e-6,    14143.495242431,  5.952658009 },
3294           {    0.017673e-6,     6812.766815086,  3.186129845 },
3295           {    0.022567e-6,     6133.512652857,  3.307984806 },
3296        /* 71, 80 */
3297           {    0.016155e-6,    10213.285546211,  1.331103168 },
3298           {    0.014751e-6,     1349.867409659,  4.308933301 },
3299           {    0.015949e-6,     -220.412642439,  4.005298270 },
3300           {    0.015974e-6,    -2352.866153772,  6.145309371 },
3301           {    0.014223e-6,    17789.845619785,  2.104551349 },
3302           {    0.017806e-6,       73.297125859,  3.475975097 },
3303           {    0.013671e-6,     -536.804512095,  5.971672571 },
3304           {    0.011942e-6,     8031.092263058,  2.053414715 },
3305           {    0.014318e-6,    16730.463689596,  3.016058075 },
3306           {    0.012462e-6,      103.092774219,  1.737438797 },
3307        /* 81, 90 */
3308           {    0.010962e-6,        3.590428652,  2.196567739 },
3309           {    0.015078e-6,    19651.048481098,  3.969480770 },
3310           {    0.010396e-6,      951.718406251,  5.717799605 },
3311           {    0.011707e-6,    -4705.732307544,  2.654125618 },
3312           {    0.010453e-6,     5863.591206116,  1.913704550 },
3313           {    0.012420e-6,     4690.479836359,  4.734090399 },
3314           {    0.011847e-6,     5643.178563677,  5.489005403 },
3315           {    0.008610e-6,     3340.612426700,  3.661698944 },
3316           {    0.011622e-6,     5120.601145584,  4.863931876 },
3317           {    0.010825e-6,      553.569402842,  0.842715011 },
3318        /* 91, 100 */
3319           {    0.008666e-6,     -135.065080035,  3.293406547 },
3320           {    0.009963e-6,      149.563197135,  4.870690598 },
3321           {    0.009858e-6,     6309.374169791,  1.061816410 },
3322           {    0.007959e-6,      316.391869657,  2.465042647 },
3323           {    0.010099e-6,      283.859318865,  1.942176992 },
3324           {    0.007147e-6,     -242.728603974,  3.661486981 },
3325           {    0.007505e-6,     5230.807466803,  4.920937029 },
3326           {    0.008323e-6,    11769.853693166,  1.229392026 },
3327           {    0.007490e-6,    -6256.777530192,  3.658444681 },
3328           {    0.009370e-6,   149854.400134205,  0.673880395 },
3329        /* 101, 110 */
3330           {    0.007117e-6,       38.027672636,  5.294249518 },
3331           {    0.007857e-6,    12168.002696575,  0.525733528 },
3332           {    0.007019e-6,     6206.809778716,  0.837688810 },
3333           {    0.006056e-6,      955.599741609,  4.194535082 },
3334           {    0.008107e-6,    13367.972631107,  3.793235253 },
3335           {    0.006731e-6,     5650.292110678,  5.639906583 },
3336           {    0.007332e-6,       36.648562930,  0.114858677 },
3337           {    0.006366e-6,     4164.311989613,  2.262081818 },
3338           {    0.006858e-6,     5216.580372801,  0.642063318 },
3339           {    0.006919e-6,     6681.224853400,  6.018501522 },
3340        /* 111, 120 */
3341           {    0.006826e-6,     7632.943259650,  3.458654112 },
3342           {    0.005308e-6,    -1592.596013633,  2.500382359 },
3343           {    0.005096e-6,    11371.704689758,  2.547107806 },
3344           {    0.004841e-6,     5333.900241022,  0.437078094 },
3345           {    0.005582e-6,     5966.683980335,  2.246174308 },
3346           {    0.006304e-6,    11926.254413669,  2.512929171 },
3347           {    0.006603e-6,    23581.258177318,  5.393136889 },
3348           {    0.005123e-6,       -1.484472708,  2.999641028 },
3349           {    0.004648e-6,     1589.072895284,  1.275847090 },
3350           {    0.005119e-6,     6438.496249426,  1.486539246 },
3351        /* 121, 130 */
3352           {    0.004521e-6,     4292.330832950,  6.140635794 },
3353           {    0.005680e-6,    23013.539539587,  4.557814849 },
3354           {    0.005488e-6,       -3.455808046,  0.090675389 },
3355           {    0.004193e-6,     7234.794256242,  4.869091389 },
3356           {    0.003742e-6,     7238.675591600,  4.691976180 },
3357           {    0.004148e-6,     -110.206321219,  3.016173439 },
3358           {    0.004553e-6,    11499.656222793,  5.554998314 },
3359           {    0.004892e-6,     5436.993015240,  1.475415597 },
3360           {    0.004044e-6,     4732.030627343,  1.398784824 },
3361           {    0.004164e-6,    12491.370101415,  5.650931916 },
3362        /* 131, 140 */
3363           {    0.004349e-6,    11513.883316794,  2.181745369 },
3364           {    0.003919e-6,    12528.018664345,  5.823319737 },
3365           {    0.003129e-6,     6836.645252834,  0.003844094 },
3366           {    0.004080e-6,    -7058.598461315,  3.690360123 },
3367           {    0.003270e-6,       76.266071276,  1.517189902 },
3368           {    0.002954e-6,     6283.143160294,  4.447203799 },
3369           {    0.002872e-6,       28.449187468,  1.158692983 },
3370           {    0.002881e-6,      735.876513532,  0.349250250 },
3371           {    0.003279e-6,     5849.364112115,  4.893384368 },
3372           {    0.003625e-6,     6209.778724132,  1.473760578 },
3373        /* 141, 150 */
3374           {    0.003074e-6,      949.175608970,  5.185878737 },
3375           {    0.002775e-6,     9917.696874510,  1.030026325 },
3376           {    0.002646e-6,    10973.555686350,  3.918259169 },
3377           {    0.002575e-6,    25132.303399966,  6.109659023 },
3378           {    0.003500e-6,      263.083923373,  1.892100742 },
3379           {    0.002740e-6,    18319.536584880,  4.320519510 },
3380           {    0.002464e-6,      202.253395174,  4.698203059 },
3381           {    0.002409e-6,        2.542797281,  5.325009315 },
3382           {    0.003354e-6,   -90955.551694697,  1.942656623 },
3383           {    0.002296e-6,     6496.374945429,  5.061810696 },
3384        /* 151, 160 */
3385           {    0.003002e-6,     6172.869528772,  2.797822767 },
3386           {    0.003202e-6,    27511.467873537,  0.531673101 },
3387           {    0.002954e-6,    -6283.008539689,  4.533471191 },
3388           {    0.002353e-6,      639.897286314,  3.734548088 },
3389           {    0.002401e-6,    16200.772724501,  2.605547070 },
3390           {    0.003053e-6,   233141.314403759,  3.029030662 },
3391           {    0.003024e-6,    83286.914269554,  2.355556099 },
3392           {    0.002863e-6,    17298.182327326,  5.240963796 },
3393           {    0.002103e-6,    -7079.373856808,  5.756641637 },
3394           {    0.002303e-6,    83996.847317911,  2.013686814 },
3395        /* 161, 170 */
3396           {    0.002303e-6,    18073.704938650,  1.089100410 },
3397           {    0.002381e-6,       63.735898303,  0.759188178 },
3398           {    0.002493e-6,     6386.168624210,  0.645026535 },
3399           {    0.002366e-6,        3.932153263,  6.215885448 },
3400           {    0.002169e-6,    11015.106477335,  4.845297676 },
3401           {    0.002397e-6,     6243.458341645,  3.809290043 },
3402           {    0.002183e-6,     1162.474704408,  6.179611691 },
3403           {    0.002353e-6,     6246.427287062,  4.781719760 },
3404           {    0.002199e-6,     -245.831646229,  5.956152284 },
3405           {    0.001729e-6,     3894.181829542,  1.264976635 },
3406        /* 171, 180 */
3407           {    0.001896e-6,    -3128.388765096,  4.914231596 },
3408           {    0.002085e-6,       35.164090221,  1.405158503 },
3409           {    0.002024e-6,    14712.317116458,  2.752035928 },
3410           {    0.001737e-6,     6290.189396992,  5.280820144 },
3411           {    0.002229e-6,      491.557929457,  1.571007057 },
3412           {    0.001602e-6,    14314.168113050,  4.203664806 },
3413           {    0.002186e-6,      454.909366527,  1.402101526 },
3414           {    0.001897e-6,    22483.848574493,  4.167932508 },
3415           {    0.001825e-6,    -3738.761430108,  0.545828785 },
3416           {    0.001894e-6,     1052.268383188,  5.817167450 },
3417        /* 181, 190 */
3418           {    0.001421e-6,       20.355319399,  2.419886601 },
3419           {    0.001408e-6,    10984.192351700,  2.732084787 },
3420           {    0.001847e-6,    10873.986030480,  2.903477885 },
3421           {    0.001391e-6,    -8635.942003763,  0.593891500 },
3422           {    0.001388e-6,       -7.046236698,  1.166145902 },
3423           {    0.001810e-6,   -88860.057071188,  0.487355242 },
3424           {    0.001288e-6,    -1990.745017041,  3.913022880 },
3425           {    0.001297e-6,    23543.230504682,  3.063805171 },
3426           {    0.001335e-6,     -266.607041722,  3.995764039 },
3427           {    0.001376e-6,    10969.965257698,  5.152914309 },
3428        /* 191, 200 */
3429           {    0.001745e-6,   244287.600007027,  3.626395673 },
3430           {    0.001649e-6,    31441.677569757,  1.952049260 },
3431           {    0.001416e-6,     9225.539273283,  4.996408389 },
3432           {    0.001238e-6,     4804.209275927,  5.503379738 },
3433           {    0.001472e-6,     4590.910180489,  4.164913291 },
3434           {    0.001169e-6,     6040.347246017,  5.841719038 },
3435           {    0.001039e-6,     5540.085789459,  2.769753519 },
3436           {    0.001004e-6,     -170.672870619,  0.755008103 },
3437           {    0.001284e-6,    10575.406682942,  5.306538209 },
3438           {    0.001278e-6,       71.812653151,  4.713486491 },
3439        /* 201, 210 */
3440           {    0.001321e-6,    18209.330263660,  2.624866359 },
3441           {    0.001297e-6,    21228.392023546,  0.382603541 },
3442           {    0.000954e-6,     6282.095528923,  0.882213514 },
3443           {    0.001145e-6,     6058.731054289,  1.169483931 },
3444           {    0.000979e-6,     5547.199336460,  5.448375984 },
3445           {    0.000987e-6,    -6262.300454499,  2.656486959 },
3446           {    0.001070e-6,  -154717.609887482,  1.827624012 },
3447           {    0.000991e-6,     4701.116501708,  4.387001801 },
3448           {    0.001155e-6,      -14.227094002,  3.042700750 },
3449           {    0.001176e-6,      277.034993741,  3.335519004 },
3450        /* 211, 220 */
3451           {    0.000890e-6,    13916.019109642,  5.601498297 },
3452           {    0.000884e-6,    -1551.045222648,  1.088831705 },
3453           {    0.000876e-6,     5017.508371365,  3.969902609 },
3454           {    0.000806e-6,    15110.466119866,  5.142876744 },
3455           {    0.000773e-6,    -4136.910433516,  0.022067765 },
3456           {    0.001077e-6,      175.166059800,  1.844913056 },
3457           {    0.000954e-6,    -6284.056171060,  0.968480906 },
3458           {    0.000737e-6,     5326.786694021,  4.923831588 },
3459           {    0.000845e-6,     -433.711737877,  4.749245231 },
3460           {    0.000819e-6,     8662.240323563,  5.991247817 },
3461        /* 221, 230 */
3462           {    0.000852e-6,      199.072001436,  2.189604979 },
3463           {    0.000723e-6,    17256.631536341,  6.068719637 },
3464           {    0.000940e-6,     6037.244203762,  6.197428148 },
3465           {    0.000885e-6,    11712.955318231,  3.280414875 },
3466           {    0.000706e-6,    12559.038152982,  2.824848947 },
3467           {    0.000732e-6,     2379.164473572,  2.501813417 },
3468           {    0.000764e-6,    -6127.655450557,  2.236346329 },
3469           {    0.000908e-6,      131.541961686,  2.521257490 },
3470           {    0.000907e-6,    35371.887265976,  3.370195967 },
3471           {    0.000673e-6,     1066.495477190,  3.876512374 },
3472        /* 231, 240 */
3473           {    0.000814e-6,    17654.780539750,  4.627122566 },
3474           {    0.000630e-6,       36.027866677,  0.156368499 },
3475           {    0.000798e-6,      515.463871093,  5.151962502 },
3476           {    0.000798e-6,      148.078724426,  5.909225055 },
3477           {    0.000806e-6,      309.278322656,  6.054064447 },
3478           {    0.000607e-6,      -39.617508346,  2.839021623 },
3479           {    0.000601e-6,      412.371096874,  3.984225404 },
3480           {    0.000646e-6,    11403.676995575,  3.852959484 },
3481           {    0.000704e-6,    13521.751441591,  2.300991267 },
3482           {    0.000603e-6,   -65147.619767937,  4.140083146 },
3483        /* 241, 250 */
3484           {    0.000609e-6,    10177.257679534,  0.437122327 },
3485           {    0.000631e-6,     5767.611978898,  4.026532329 },
3486           {    0.000576e-6,    11087.285125918,  4.760293101 },
3487           {    0.000674e-6,    14945.316173554,  6.270510511 },
3488           {    0.000726e-6,     5429.879468239,  6.039606892 },
3489           {    0.000710e-6,    28766.924424484,  5.672617711 },
3490           {    0.000647e-6,    11856.218651625,  3.397132627 },
3491           {    0.000678e-6,    -5481.254918868,  6.249666675 },
3492           {    0.000618e-6,    22003.914634870,  2.466427018 },
3493           {    0.000738e-6,     6134.997125565,  2.242668890 },
3494        /* 251, 260 */
3495           {    0.000660e-6,      625.670192312,  5.864091907 },
3496           {    0.000694e-6,     3496.032826134,  2.668309141 },
3497           {    0.000531e-6,     6489.261398429,  1.681888780 },
3498           {    0.000611e-6,  -143571.324284214,  2.424978312 },
3499           {    0.000575e-6,    12043.574281889,  4.216492400 },
3500           {    0.000553e-6,    12416.588502848,  4.772158039 },
3501           {    0.000689e-6,     4686.889407707,  6.224271088 },
3502           {    0.000495e-6,     7342.457780181,  3.817285811 },
3503           {    0.000567e-6,     3634.621024518,  1.649264690 },
3504           {    0.000515e-6,    18635.928454536,  3.945345892 },
3505        /* 261, 270 */
3506           {    0.000486e-6,     -323.505416657,  4.061673868 },
3507           {    0.000662e-6,    25158.601719765,  1.794058369 },
3508           {    0.000509e-6,      846.082834751,  3.053874588 },
3509           {    0.000472e-6,   -12569.674818332,  5.112133338 },
3510           {    0.000461e-6,     6179.983075773,  0.513669325 },
3511           {    0.000641e-6,    83467.156352816,  3.210727723 },
3512           {    0.000520e-6,    10344.295065386,  2.445597761 },
3513           {    0.000493e-6,    18422.629359098,  1.676939306 },
3514           {    0.000478e-6,     1265.567478626,  5.487314569 },
3515           {    0.000472e-6,      -18.159247265,  1.999707589 },
3516        /* 271, 280 */
3517           {    0.000559e-6,    11190.377900137,  5.783236356 },
3518           {    0.000494e-6,     9623.688276691,  3.022645053 },
3519           {    0.000463e-6,     5739.157790895,  1.411223013 },
3520           {    0.000432e-6,    16858.482532933,  1.179256434 },
3521           {    0.000574e-6,    72140.628666286,  1.758191830 },
3522           {    0.000484e-6,    17267.268201691,  3.290589143 },
3523           {    0.000550e-6,     4907.302050146,  0.864024298 },
3524           {    0.000399e-6,       14.977853527,  2.094441910 },
3525           {    0.000491e-6,      224.344795702,  0.878372791 },
3526           {    0.000432e-6,    20426.571092422,  6.003829241 },
3527        /* 281, 290 */
3528           {    0.000481e-6,     5749.452731634,  4.309591964 },
3529           {    0.000480e-6,     5757.317038160,  1.142348571 },
3530           {    0.000485e-6,     6702.560493867,  0.210580917 },
3531           {    0.000426e-6,     6055.549660552,  4.274476529 },
3532           {    0.000480e-6,     5959.570433334,  5.031351030 },
3533           {    0.000466e-6,    12562.628581634,  4.959581597 },
3534           {    0.000520e-6,    39302.096962196,  4.788002889 },
3535           {    0.000458e-6,    12132.439962106,  1.880103788 },
3536           {    0.000470e-6,    12029.347187887,  1.405611197 },
3537           {    0.000416e-6,    -7477.522860216,  1.082356330 },
3538        /* 291, 300 */
3539           {    0.000449e-6,    11609.862544012,  4.179989585 },
3540           {    0.000465e-6,    17253.041107690,  0.353496295 },
3541           {    0.000362e-6,    -4535.059436924,  1.583849576 },
3542           {    0.000383e-6,    21954.157609398,  3.747376371 },
3543           {    0.000389e-6,       17.252277143,  1.395753179 },
3544           {    0.000331e-6,    18052.929543158,  0.566790582 },
3545           {    0.000430e-6,    13517.870106233,  0.685827538 },
3546           {    0.000368e-6,    -5756.908003246,  0.731374317 },
3547           {    0.000330e-6,    10557.594160824,  3.710043680 },
3548           {    0.000332e-6,    20199.094959633,  1.652901407 },
3549        /* 301, 310 */
3550           {    0.000384e-6,    11933.367960670,  5.827781531 },
3551           {    0.000387e-6,    10454.501386605,  2.541182564 },
3552           {    0.000325e-6,    15671.081759407,  2.178850542 },
3553           {    0.000318e-6,      138.517496871,  2.253253037 },
3554           {    0.000305e-6,     9388.005909415,  0.578340206 },
3555           {    0.000352e-6,     5749.861766548,  3.000297967 },
3556           {    0.000311e-6,     6915.859589305,  1.693574249 },
3557           {    0.000297e-6,    24072.921469776,  1.997249392 },
3558           {    0.000363e-6,     -640.877607382,  5.071820966 },
3559           {    0.000323e-6,    12592.450019783,  1.072262823 },
3560        /* 311, 320 */
3561           {    0.000341e-6,    12146.667056108,  4.700657997 },
3562           {    0.000290e-6,     9779.108676125,  1.812320441 },
3563           {    0.000342e-6,     6132.028180148,  4.322238614 },
3564           {    0.000329e-6,     6268.848755990,  3.033827743 },
3565           {    0.000374e-6,    17996.031168222,  3.388716544 },
3566           {    0.000285e-6,     -533.214083444,  4.687313233 },
3567           {    0.000338e-6,     6065.844601290,  0.877776108 },
3568           {    0.000276e-6,       24.298513841,  0.770299429 },
3569           {    0.000336e-6,    -2388.894020449,  5.353796034 },
3570           {    0.000290e-6,     3097.883822726,  4.075291557 },
3571        /* 321, 330 */
3572           {    0.000318e-6,      709.933048357,  5.941207518 },
3573           {    0.000271e-6,    13095.842665077,  3.208912203 },
3574           {    0.000331e-6,     6073.708907816,  4.007881169 },
3575           {    0.000292e-6,      742.990060533,  2.714333592 },
3576           {    0.000362e-6,    29088.811415985,  3.215977013 },
3577           {    0.000280e-6,    12359.966151546,  0.710872502 },
3578           {    0.000267e-6,    10440.274292604,  4.730108488 },
3579           {    0.000262e-6,      838.969287750,  1.327720272 },
3580           {    0.000250e-6,    16496.361396202,  0.898769761 },
3581           {    0.000325e-6,    20597.243963041,  0.180044365 },
3582        /* 331, 340 */
3583           {    0.000268e-6,     6148.010769956,  5.152666276 },
3584           {    0.000284e-6,     5636.065016677,  5.655385808 },
3585           {    0.000301e-6,     6080.822454817,  2.135396205 },
3586           {    0.000294e-6,     -377.373607916,  3.708784168 },
3587           {    0.000236e-6,     2118.763860378,  1.733578756 },
3588           {    0.000234e-6,     5867.523359379,  5.575209112 },
3589           {    0.000268e-6,  -226858.238553767,  0.069432392 },
3590           {    0.000265e-6,   167283.761587465,  4.369302826 },
3591           {    0.000280e-6,    28237.233459389,  5.304829118 },
3592           {    0.000292e-6,    12345.739057544,  4.096094132 },
3593        /* 341, 350 */
3594           {    0.000223e-6,    19800.945956225,  3.069327406 },
3595           {    0.000301e-6,    43232.306658416,  6.205311188 },
3596           {    0.000264e-6,    18875.525869774,  1.417263408 },
3597           {    0.000304e-6,    -1823.175188677,  3.409035232 },
3598           {    0.000301e-6,      109.945688789,  0.510922054 },
3599           {    0.000260e-6,      813.550283960,  2.389438934 },
3600           {    0.000299e-6,   316428.228673312,  5.384595078 },
3601           {    0.000211e-6,     5756.566278634,  3.789392838 },
3602           {    0.000209e-6,     5750.203491159,  1.661943545 },
3603           {    0.000240e-6,    12489.885628707,  5.684549045 },
3604        /* 351, 360 */
3605           {    0.000216e-6,     6303.851245484,  3.862942261 },
3606           {    0.000203e-6,     1581.959348283,  5.549853589 },
3607           {    0.000200e-6,     5642.198242609,  1.016115785 },
3608           {    0.000197e-6,      -70.849445304,  4.690702525 },
3609           {    0.000227e-6,     6287.008003254,  2.911891613 },
3610           {    0.000197e-6,      533.623118358,  1.048982898 },
3611           {    0.000205e-6,    -6279.485421340,  1.829362730 },
3612           {    0.000209e-6,   -10988.808157535,  2.636140084 },
3613           {    0.000208e-6,     -227.526189440,  4.127883842 },
3614           {    0.000191e-6,      415.552490612,  4.401165650 },
3615        /* 361, 370 */
3616           {    0.000190e-6,    29296.615389579,  4.175658539 },
3617           {    0.000264e-6,    66567.485864652,  4.601102551 },
3618           {    0.000256e-6,    -3646.350377354,  0.506364778 },
3619           {    0.000188e-6,    13119.721102825,  2.032195842 },
3620           {    0.000185e-6,     -209.366942175,  4.694756586 },
3621           {    0.000198e-6,    25934.124331089,  3.832703118 },
3622           {    0.000195e-6,     4061.219215394,  3.308463427 },
3623           {    0.000234e-6,     5113.487598583,  1.716090661 },
3624           {    0.000188e-6,     1478.866574064,  5.686865780 },
3625           {    0.000222e-6,    11823.161639450,  1.942386641 },
3626        /* 371, 380 */
3627           {    0.000181e-6,    10770.893256262,  1.999482059 },
3628           {    0.000171e-6,     6546.159773364,  1.182807992 },
3629           {    0.000206e-6,       70.328180442,  5.934076062 },
3630           {    0.000169e-6,    20995.392966449,  2.169080622 },
3631           {    0.000191e-6,    10660.686935042,  5.405515999 },
3632           {    0.000228e-6,    33019.021112205,  4.656985514 },
3633           {    0.000184e-6,    -4933.208440333,  3.327476868 },
3634           {    0.000220e-6,     -135.625325010,  1.765430262 },
3635           {    0.000166e-6,    23141.558382925,  3.454132746 },
3636           {    0.000191e-6,     6144.558353121,  5.020393445 },
3637        /* 381, 390 */
3638           {    0.000180e-6,     6084.003848555,  0.602182191 },
3639           {    0.000163e-6,    17782.732072784,  4.960593133 },
3640           {    0.000225e-6,    16460.333529525,  2.596451817 },
3641           {    0.000222e-6,     5905.702242076,  3.731990323 },
3642           {    0.000204e-6,      227.476132789,  5.636192701 },
3643           {    0.000159e-6,    16737.577236597,  3.600691544 },
3644           {    0.000200e-6,     6805.653268085,  0.868220961 },
3645           {    0.000187e-6,    11919.140866668,  2.629456641 },
3646           {    0.000161e-6,      127.471796607,  2.862574720 },
3647           {    0.000205e-6,     6286.666278643,  1.742882331 },
3648        /* 391, 400 */
3649           {    0.000189e-6,      153.778810485,  4.812372643 },
3650           {    0.000168e-6,    16723.350142595,  0.027860588 },
3651           {    0.000149e-6,    11720.068865232,  0.659721876 },
3652           {    0.000189e-6,     5237.921013804,  5.245313000 },
3653           {    0.000143e-6,     6709.674040867,  4.317625647 },
3654           {    0.000146e-6,     4487.817406270,  4.815297007 },
3655           {    0.000144e-6,     -664.756045130,  5.381366880 },
3656           {    0.000175e-6,     5127.714692584,  4.728443327 },
3657           {    0.000162e-6,     6254.626662524,  1.435132069 },
3658           {    0.000187e-6,    47162.516354635,  1.354371923 },
3659        /* 401, 410 */
3660           {    0.000146e-6,    11080.171578918,  3.369695406 },
3661           {    0.000180e-6,     -348.924420448,  2.490902145 },
3662           {    0.000148e-6,      151.047669843,  3.799109588 },
3663           {    0.000157e-6,     6197.248551160,  1.284375887 },
3664           {    0.000167e-6,      146.594251718,  0.759969109 },
3665           {    0.000133e-6,    -5331.357443741,  5.409701889 },
3666           {    0.000154e-6,       95.979227218,  3.366890614 },
3667           {    0.000148e-6,    -6418.140930027,  3.384104996 },
3668           {    0.000128e-6,    -6525.804453965,  3.803419985 },
3669           {    0.000130e-6,    11293.470674356,  0.939039445 },
3670        /* 411, 420 */
3671           {    0.000152e-6,    -5729.506447149,  0.734117523 },
3672           {    0.000138e-6,      210.117701700,  2.564216078 },
3673           {    0.000123e-6,     6066.595360816,  4.517099537 },
3674           {    0.000140e-6,    18451.078546566,  0.642049130 },
3675           {    0.000126e-6,    11300.584221356,  3.485280663 },
3676           {    0.000119e-6,    10027.903195729,  3.217431161 },
3677           {    0.000151e-6,     4274.518310832,  4.404359108 },
3678           {    0.000117e-6,     6072.958148291,  0.366324650 },
3679           {    0.000165e-6,    -7668.637425143,  4.298212528 },
3680           {    0.000117e-6,    -6245.048177356,  5.379518958 },
3681        /* 421, 430 */
3682           {    0.000130e-6,    -5888.449964932,  4.527681115 },
3683           {    0.000121e-6,     -543.918059096,  6.109429504 },
3684           {    0.000162e-6,     9683.594581116,  5.720092446 },
3685           {    0.000141e-6,     6219.339951688,  0.679068671 },
3686           {    0.000118e-6,    22743.409379516,  4.881123092 },
3687           {    0.000129e-6,     1692.165669502,  0.351407289 },
3688           {    0.000126e-6,     5657.405657679,  5.146592349 },
3689           {    0.000114e-6,      728.762966531,  0.520791814 },
3690           {    0.000120e-6,       52.596639600,  0.948516300 },
3691           {    0.000115e-6,       65.220371012,  3.504914846 },
3692        /* 431, 440 */
3693           {    0.000126e-6,     5881.403728234,  5.577502482 },
3694           {    0.000158e-6,   163096.180360983,  2.957128968 },
3695           {    0.000134e-6,    12341.806904281,  2.598576764 },
3696           {    0.000151e-6,    16627.370915377,  3.985702050 },
3697           {    0.000109e-6,     1368.660252845,  0.014730471 },
3698           {    0.000131e-6,     6211.263196841,  0.085077024 },
3699           {    0.000146e-6,     5792.741760812,  0.708426604 },
3700           {    0.000146e-6,      -77.750543984,  3.121576600 },
3701           {    0.000107e-6,     5341.013788022,  0.288231904 },
3702           {    0.000138e-6,     6281.591377283,  2.797450317 },
3703        /* 441, 450 */
3704           {    0.000113e-6,    -6277.552925684,  2.788904128 },
3705           {    0.000115e-6,     -525.758811831,  5.895222200 },
3706           {    0.000138e-6,     6016.468808270,  6.096188999 },
3707           {    0.000139e-6,    23539.707386333,  2.028195445 },
3708           {    0.000146e-6,    -4176.041342449,  4.660008502 },
3709           {    0.000107e-6,    16062.184526117,  4.066520001 },
3710           {    0.000142e-6,    83783.548222473,  2.936315115 },
3711           {    0.000128e-6,     9380.959672717,  3.223844306 },
3712           {    0.000135e-6,     6205.325306007,  1.638054048 },
3713           {    0.000101e-6,     2699.734819318,  5.481603249 },
3714        /* 451, 460 */
3715           {    0.000104e-6,     -568.821874027,  2.205734493 },
3716           {    0.000103e-6,     6321.103522627,  2.440421099 },
3717           {    0.000119e-6,     6321.208885629,  2.547496264 },
3718           {    0.000138e-6,     1975.492545856,  2.314608466 },
3719           {    0.000121e-6,      137.033024162,  4.539108237 },
3720           {    0.000123e-6,    19402.796952817,  4.538074405 },
3721           {    0.000119e-6,    22805.735565994,  2.869040566 },
3722           {    0.000133e-6,    64471.991241142,  6.056405489 },
3723           {    0.000129e-6,      -85.827298831,  2.540635083 },
3724           {    0.000131e-6,    13613.804277336,  4.005732868 },
3725        /* 461, 470 */
3726           {    0.000104e-6,     9814.604100291,  1.959967212 },
3727           {    0.000112e-6,    16097.679950283,  3.589026260 },
3728           {    0.000123e-6,     2107.034507542,  1.728627253 },
3729           {    0.000121e-6,    36949.230808424,  6.072332087 },
3730           {    0.000108e-6,   -12539.853380183,  3.716133846 },
3731           {    0.000113e-6,    -7875.671863624,  2.725771122 },
3732           {    0.000109e-6,     4171.425536614,  4.033338079 },
3733           {    0.000101e-6,     6247.911759770,  3.441347021 },
3734           {    0.000113e-6,     7330.728427345,  0.656372122 },
3735           {    0.000113e-6,    51092.726050855,  2.791483066 },
3736        /* 471, 480 */
3737           {    0.000106e-6,     5621.842923210,  1.815323326 },
3738           {    0.000101e-6,      111.430161497,  5.711033677 },
3739           {    0.000103e-6,      909.818733055,  2.812745443 },
3740           {    0.000101e-6,     1790.642637886,  1.965746028 },
3741 
3742        /* T */
3743           {  102.156724e-6,     6283.075849991,  4.249032005 },
3744           {    1.706807e-6,    12566.151699983,  4.205904248 },
3745           {    0.269668e-6,      213.299095438,  3.400290479 },
3746           {    0.265919e-6,      529.690965095,  5.836047367 },
3747           {    0.210568e-6,       -3.523118349,  6.262738348 },
3748           {    0.077996e-6,     5223.693919802,  4.670344204 },
3749        /* 481, 490 */
3750           {    0.054764e-6,     1577.343542448,  4.534800170 },
3751           {    0.059146e-6,       26.298319800,  1.083044735 },
3752           {    0.034420e-6,     -398.149003408,  5.980077351 },
3753           {    0.032088e-6,    18849.227549974,  4.162913471 },
3754           {    0.033595e-6,     5507.553238667,  5.980162321 },
3755           {    0.029198e-6,     5856.477659115,  0.623811863 },
3756           {    0.027764e-6,      155.420399434,  3.745318113 },
3757           {    0.025190e-6,     5746.271337896,  2.980330535 },
3758           {    0.022997e-6,     -796.298006816,  1.174411803 },
3759           {    0.024976e-6,     5760.498431898,  2.467913690 },
3760        /* 491, 500 */
3761           {    0.021774e-6,      206.185548437,  3.854787540 },
3762           {    0.017925e-6,     -775.522611324,  1.092065955 },
3763           {    0.013794e-6,      426.598190876,  2.699831988 },
3764           {    0.013276e-6,     6062.663207553,  5.845801920 },
3765           {    0.011774e-6,    12036.460734888,  2.292832062 },
3766           {    0.012869e-6,     6076.890301554,  5.333425680 },
3767           {    0.012152e-6,     1059.381930189,  6.222874454 },
3768           {    0.011081e-6,       -7.113547001,  5.154724984 },
3769           {    0.010143e-6,     4694.002954708,  4.044013795 },
3770           {    0.009357e-6,     5486.777843175,  3.416081409 },
3771        /* 501, 510 */
3772           {    0.010084e-6,      522.577418094,  0.749320262 },
3773           {    0.008587e-6,    10977.078804699,  2.777152598 },
3774           {    0.008628e-6,     6275.962302991,  4.562060226 },
3775           {    0.008158e-6,     -220.412642439,  5.806891533 },
3776           {    0.007746e-6,     2544.314419883,  1.603197066 },
3777           {    0.007670e-6,     2146.165416475,  3.000200440 },
3778           {    0.007098e-6,       74.781598567,  0.443725817 },
3779           {    0.006180e-6,     -536.804512095,  1.302642751 },
3780           {    0.005818e-6,     5088.628839767,  4.827723531 },
3781           {    0.004945e-6,    -6286.598968340,  0.268305170 },
3782        /* 511, 520 */
3783           {    0.004774e-6,     1349.867409659,  5.808636673 },
3784           {    0.004687e-6,     -242.728603974,  5.154890570 },
3785           {    0.006089e-6,     1748.016413067,  4.403765209 },
3786           {    0.005975e-6,    -1194.447010225,  2.583472591 },
3787           {    0.004229e-6,      951.718406251,  0.931172179 },
3788           {    0.005264e-6,      553.569402842,  2.336107252 },
3789           {    0.003049e-6,     5643.178563677,  1.362634430 },
3790           {    0.002974e-6,     6812.766815086,  1.583012668 },
3791           {    0.003403e-6,    -2352.866153772,  2.552189886 },
3792           {    0.003030e-6,      419.484643875,  5.286473844 },
3793        /* 521, 530 */
3794           {    0.003210e-6,       -7.046236698,  1.863796539 },
3795           {    0.003058e-6,     9437.762934887,  4.226420633 },
3796           {    0.002589e-6,    12352.852604545,  1.991935820 },
3797           {    0.002927e-6,     5216.580372801,  2.319951253 },
3798           {    0.002425e-6,     5230.807466803,  3.084752833 },
3799           {    0.002656e-6,     3154.687084896,  2.487447866 },
3800           {    0.002445e-6,    10447.387839604,  2.347139160 },
3801           {    0.002990e-6,     4690.479836359,  6.235872050 },
3802           {    0.002890e-6,     5863.591206116,  0.095197563 },
3803           {    0.002498e-6,     6438.496249426,  2.994779800 },
3804        /* 531, 540 */
3805           {    0.001889e-6,     8031.092263058,  3.569003717 },
3806           {    0.002567e-6,      801.820931124,  3.425611498 },
3807           {    0.001803e-6,   -71430.695617928,  2.192295512 },
3808           {    0.001782e-6,        3.932153263,  5.180433689 },
3809           {    0.001694e-6,    -4705.732307544,  4.641779174 },
3810           {    0.001704e-6,    -1592.596013633,  3.997097652 },
3811           {    0.001735e-6,     5849.364112115,  0.417558428 },
3812           {    0.001643e-6,     8429.241266467,  2.180619584 },
3813           {    0.001680e-6,       38.133035638,  4.164529426 },
3814           {    0.002045e-6,     7084.896781115,  0.526323854 },
3815        /* 541, 550 */
3816           {    0.001458e-6,     4292.330832950,  1.356098141 },
3817           {    0.001437e-6,       20.355319399,  3.895439360 },
3818           {    0.001738e-6,     6279.552731642,  0.087484036 },
3819           {    0.001367e-6,    14143.495242431,  3.987576591 },
3820           {    0.001344e-6,     7234.794256242,  0.090454338 },
3821           {    0.001438e-6,    11499.656222793,  0.974387904 },
3822           {    0.001257e-6,     6836.645252834,  1.509069366 },
3823           {    0.001358e-6,    11513.883316794,  0.495572260 },
3824           {    0.001628e-6,     7632.943259650,  4.968445721 },
3825           {    0.001169e-6,      103.092774219,  2.838496795 },
3826        /* 551, 560 */
3827           {    0.001162e-6,     4164.311989613,  3.408387778 },
3828           {    0.001092e-6,     6069.776754553,  3.617942651 },
3829           {    0.001008e-6,    17789.845619785,  0.286350174 },
3830           {    0.001008e-6,      639.897286314,  1.610762073 },
3831           {    0.000918e-6,    10213.285546211,  5.532798067 },
3832           {    0.001011e-6,    -6256.777530192,  0.661826484 },
3833           {    0.000753e-6,    16730.463689596,  3.905030235 },
3834           {    0.000737e-6,    11926.254413669,  4.641956361 },
3835           {    0.000694e-6,     3340.612426700,  2.111120332 },
3836           {    0.000701e-6,     3894.181829542,  2.760823491 },
3837        /* 561, 570 */
3838           {    0.000689e-6,     -135.065080035,  4.768800780 },
3839           {    0.000700e-6,    13367.972631107,  5.760439898 },
3840           {    0.000664e-6,     6040.347246017,  1.051215840 },
3841           {    0.000654e-6,     5650.292110678,  4.911332503 },
3842           {    0.000788e-6,     6681.224853400,  4.699648011 },
3843           {    0.000628e-6,     5333.900241022,  5.024608847 },
3844           {    0.000755e-6,     -110.206321219,  4.370971253 },
3845           {    0.000628e-6,     6290.189396992,  3.660478857 },
3846           {    0.000635e-6,    25132.303399966,  4.121051532 },
3847           {    0.000534e-6,     5966.683980335,  1.173284524 },
3848        /* 571, 580 */
3849           {    0.000543e-6,     -433.711737877,  0.345585464 },
3850           {    0.000517e-6,    -1990.745017041,  5.414571768 },
3851           {    0.000504e-6,     5767.611978898,  2.328281115 },
3852           {    0.000485e-6,     5753.384884897,  1.685874771 },
3853           {    0.000463e-6,     7860.419392439,  5.297703006 },
3854           {    0.000604e-6,      515.463871093,  0.591998446 },
3855           {    0.000443e-6,    12168.002696575,  4.830881244 },
3856           {    0.000570e-6,      199.072001436,  3.899190272 },
3857           {    0.000465e-6,    10969.965257698,  0.476681802 },
3858           {    0.000424e-6,    -7079.373856808,  1.112242763 },
3859        /* 581, 590 */
3860           {    0.000427e-6,      735.876513532,  1.994214480 },
3861           {    0.000478e-6,    -6127.655450557,  3.778025483 },
3862           {    0.000414e-6,    10973.555686350,  5.441088327 },
3863           {    0.000512e-6,     1589.072895284,  0.107123853 },
3864           {    0.000378e-6,    10984.192351700,  0.915087231 },
3865           {    0.000402e-6,    11371.704689758,  4.107281715 },
3866           {    0.000453e-6,     9917.696874510,  1.917490952 },
3867           {    0.000395e-6,      149.563197135,  2.763124165 },
3868           {    0.000371e-6,     5739.157790895,  3.112111866 },
3869           {    0.000350e-6,    11790.629088659,  0.440639857 },
3870        /* 591, 600 */
3871           {    0.000356e-6,     6133.512652857,  5.444568842 },
3872           {    0.000344e-6,      412.371096874,  5.676832684 },
3873           {    0.000383e-6,      955.599741609,  5.559734846 },
3874           {    0.000333e-6,     6496.374945429,  0.261537984 },
3875           {    0.000340e-6,     6055.549660552,  5.975534987 },
3876           {    0.000334e-6,     1066.495477190,  2.335063907 },
3877           {    0.000399e-6,    11506.769769794,  5.321230910 },
3878           {    0.000314e-6,    18319.536584880,  2.313312404 },
3879           {    0.000424e-6,     1052.268383188,  1.211961766 },
3880           {    0.000307e-6,       63.735898303,  3.169551388 },
3881        /* 601, 610 */
3882           {    0.000329e-6,       29.821438149,  6.106912080 },
3883           {    0.000357e-6,     6309.374169791,  4.223760346 },
3884           {    0.000312e-6,    -3738.761430108,  2.180556645 },
3885           {    0.000301e-6,      309.278322656,  1.499984572 },
3886           {    0.000268e-6,    12043.574281889,  2.447520648 },
3887           {    0.000257e-6,    12491.370101415,  3.662331761 },
3888           {    0.000290e-6,      625.670192312,  1.272834584 },
3889           {    0.000256e-6,     5429.879468239,  1.913426912 },
3890           {    0.000339e-6,     3496.032826134,  4.165930011 },
3891           {    0.000283e-6,     3930.209696220,  4.325565754 },
3892        /* 611, 620 */
3893           {    0.000241e-6,    12528.018664345,  3.832324536 },
3894           {    0.000304e-6,     4686.889407707,  1.612348468 },
3895           {    0.000259e-6,    16200.772724501,  3.470173146 },
3896           {    0.000238e-6,    12139.553509107,  1.147977842 },
3897           {    0.000236e-6,     6172.869528772,  3.776271728 },
3898           {    0.000296e-6,    -7058.598461315,  0.460368852 },
3899           {    0.000306e-6,    10575.406682942,  0.554749016 },
3900           {    0.000251e-6,    17298.182327326,  0.834332510 },
3901           {    0.000290e-6,     4732.030627343,  4.759564091 },
3902           {    0.000261e-6,     5884.926846583,  0.298259862 },
3903        /* 621, 630 */
3904           {    0.000249e-6,     5547.199336460,  3.749366406 },
3905           {    0.000213e-6,    11712.955318231,  5.415666119 },
3906           {    0.000223e-6,     4701.116501708,  2.703203558 },
3907           {    0.000268e-6,     -640.877607382,  0.283670793 },
3908           {    0.000209e-6,     5636.065016677,  1.238477199 },
3909           {    0.000193e-6,    10177.257679534,  1.943251340 },
3910           {    0.000182e-6,     6283.143160294,  2.456157599 },
3911           {    0.000184e-6,     -227.526189440,  5.888038582 },
3912           {    0.000182e-6,    -6283.008539689,  0.241332086 },
3913           {    0.000228e-6,    -6284.056171060,  2.657323816 },
3914        /* 631, 640 */
3915           {    0.000166e-6,     7238.675591600,  5.930629110 },
3916           {    0.000167e-6,     3097.883822726,  5.570955333 },
3917           {    0.000159e-6,     -323.505416657,  5.786670700 },
3918           {    0.000154e-6,    -4136.910433516,  1.517805532 },
3919           {    0.000176e-6,    12029.347187887,  3.139266834 },
3920           {    0.000167e-6,    12132.439962106,  3.556352289 },
3921           {    0.000153e-6,      202.253395174,  1.463313961 },
3922           {    0.000157e-6,    17267.268201691,  1.586837396 },
3923           {    0.000142e-6,    83996.847317911,  0.022670115 },
3924           {    0.000152e-6,    17260.154654690,  0.708528947 },
3925        /* 641, 650 */
3926           {    0.000144e-6,     6084.003848555,  5.187075177 },
3927           {    0.000135e-6,     5756.566278634,  1.993229262 },
3928           {    0.000134e-6,     5750.203491159,  3.457197134 },
3929           {    0.000144e-6,     5326.786694021,  6.066193291 },
3930           {    0.000160e-6,    11015.106477335,  1.710431974 },
3931           {    0.000133e-6,     3634.621024518,  2.836451652 },
3932           {    0.000134e-6,    18073.704938650,  5.453106665 },
3933           {    0.000134e-6,     1162.474704408,  5.326898811 },
3934           {    0.000128e-6,     5642.198242609,  2.511652591 },
3935           {    0.000160e-6,      632.783739313,  5.628785365 },
3936        /* 651, 660 */
3937           {    0.000132e-6,    13916.019109642,  0.819294053 },
3938           {    0.000122e-6,    14314.168113050,  5.677408071 },
3939           {    0.000125e-6,    12359.966151546,  5.251984735 },
3940           {    0.000121e-6,     5749.452731634,  2.210924603 },
3941           {    0.000136e-6,     -245.831646229,  1.646502367 },
3942           {    0.000120e-6,     5757.317038160,  3.240883049 },
3943           {    0.000134e-6,    12146.667056108,  3.059480037 },
3944           {    0.000137e-6,     6206.809778716,  1.867105418 },
3945           {    0.000141e-6,    17253.041107690,  2.069217456 },
3946           {    0.000129e-6,    -7477.522860216,  2.781469314 },
3947        /* 661, 670 */
3948           {    0.000116e-6,     5540.085789459,  4.281176991 },
3949           {    0.000116e-6,     9779.108676125,  3.320925381 },
3950           {    0.000129e-6,     5237.921013804,  3.497704076 },
3951           {    0.000113e-6,     5959.570433334,  0.983210840 },
3952           {    0.000122e-6,     6282.095528923,  2.674938860 },
3953           {    0.000140e-6,      -11.045700264,  4.957936982 },
3954           {    0.000108e-6,    23543.230504682,  1.390113589 },
3955           {    0.000106e-6,   -12569.674818332,  0.429631317 },
3956           {    0.000110e-6,     -266.607041722,  5.501340197 },
3957           {    0.000115e-6,    12559.038152982,  4.691456618 },
3958        /* 671, 680 */
3959           {    0.000134e-6,    -2388.894020449,  0.577313584 },
3960           {    0.000109e-6,    10440.274292604,  6.218148717 },
3961           {    0.000102e-6,     -543.918059096,  1.477842615 },
3962           {    0.000108e-6,    21228.392023546,  2.237753948 },
3963           {    0.000101e-6,    -4535.059436924,  3.100492232 },
3964           {    0.000103e-6,       76.266071276,  5.594294322 },
3965           {    0.000104e-6,      949.175608970,  5.674287810 },
3966           {    0.000101e-6,    13517.870106233,  2.196632348 },
3967           {    0.000100e-6,    11933.367960670,  4.056084160 },
3968 
3969        /* T^2 */
3970           {    4.322990e-6,     6283.075849991,  2.642893748 },
3971        /* 681, 690 */
3972           {    0.406495e-6,        0.000000000,  4.712388980 },
3973           {    0.122605e-6,    12566.151699983,  2.438140634 },
3974           {    0.019476e-6,      213.299095438,  1.642186981 },
3975           {    0.016916e-6,      529.690965095,  4.510959344 },
3976           {    0.013374e-6,       -3.523118349,  1.502210314 },
3977           {    0.008042e-6,       26.298319800,  0.478549024 },
3978           {    0.007824e-6,      155.420399434,  5.254710405 },
3979           {    0.004894e-6,     5746.271337896,  4.683210850 },
3980           {    0.004875e-6,     5760.498431898,  0.759507698 },
3981           {    0.004416e-6,     5223.693919802,  6.028853166 },
3982        /* 691, 700 */
3983           {    0.004088e-6,       -7.113547001,  0.060926389 },
3984           {    0.004433e-6,    77713.771467920,  3.627734103 },
3985           {    0.003277e-6,    18849.227549974,  2.327912542 },
3986           {    0.002703e-6,     6062.663207553,  1.271941729 },
3987           {    0.003435e-6,     -775.522611324,  0.747446224 },
3988           {    0.002618e-6,     6076.890301554,  3.633715689 },
3989           {    0.003146e-6,      206.185548437,  5.647874613 },
3990           {    0.002544e-6,     1577.343542448,  6.232904270 },
3991           {    0.002218e-6,     -220.412642439,  1.309509946 },
3992           {    0.002197e-6,     5856.477659115,  2.407212349 },
3993        /* 701, 710 */
3994           {    0.002897e-6,     5753.384884897,  5.863842246 },
3995           {    0.001766e-6,      426.598190876,  0.754113147 },
3996           {    0.001738e-6,     -796.298006816,  2.714942671 },
3997           {    0.001695e-6,      522.577418094,  2.629369842 },
3998           {    0.001584e-6,     5507.553238667,  1.341138229 },
3999           {    0.001503e-6,     -242.728603974,  0.377699736 },
4000           {    0.001552e-6,     -536.804512095,  2.904684667 },
4001           {    0.001370e-6,     -398.149003408,  1.265599125 },
4002           {    0.001889e-6,    -5573.142801634,  4.413514859 },
4003           {    0.001722e-6,     6069.776754553,  2.445966339 },
4004        /* 711, 720 */
4005           {    0.001124e-6,     1059.381930189,  5.041799657 },
4006           {    0.001258e-6,      553.569402842,  3.849557278 },
4007           {    0.000831e-6,      951.718406251,  2.471094709 },
4008           {    0.000767e-6,     4694.002954708,  5.363125422 },
4009           {    0.000756e-6,     1349.867409659,  1.046195744 },
4010           {    0.000775e-6,      -11.045700264,  0.245548001 },
4011           {    0.000597e-6,     2146.165416475,  4.543268798 },
4012           {    0.000568e-6,     5216.580372801,  4.178853144 },
4013           {    0.000711e-6,     1748.016413067,  5.934271972 },
4014           {    0.000499e-6,    12036.460734888,  0.624434410 },
4015        /* 721, 730 */
4016           {    0.000671e-6,    -1194.447010225,  4.136047594 },
4017           {    0.000488e-6,     5849.364112115,  2.209679987 },
4018           {    0.000621e-6,     6438.496249426,  4.518860804 },
4019           {    0.000495e-6,    -6286.598968340,  1.868201275 },
4020           {    0.000456e-6,     5230.807466803,  1.271231591 },
4021           {    0.000451e-6,     5088.628839767,  0.084060889 },
4022           {    0.000435e-6,     5643.178563677,  3.324456609 },
4023           {    0.000387e-6,    10977.078804699,  4.052488477 },
4024           {    0.000547e-6,   161000.685737473,  2.841633844 },
4025           {    0.000522e-6,     3154.687084896,  2.171979966 },
4026        /* 731, 740 */
4027           {    0.000375e-6,     5486.777843175,  4.983027306 },
4028           {    0.000421e-6,     5863.591206116,  4.546432249 },
4029           {    0.000439e-6,     7084.896781115,  0.522967921 },
4030           {    0.000309e-6,     2544.314419883,  3.172606705 },
4031           {    0.000347e-6,     4690.479836359,  1.479586566 },
4032           {    0.000317e-6,      801.820931124,  3.553088096 },
4033           {    0.000262e-6,      419.484643875,  0.606635550 },
4034           {    0.000248e-6,     6836.645252834,  3.014082064 },
4035           {    0.000245e-6,    -1592.596013633,  5.519526220 },
4036           {    0.000225e-6,     4292.330832950,  2.877956536 },
4037        /* 741, 750 */
4038           {    0.000214e-6,     7234.794256242,  1.605227587 },
4039           {    0.000205e-6,     5767.611978898,  0.625804796 },
4040           {    0.000180e-6,    10447.387839604,  3.499954526 },
4041           {    0.000229e-6,      199.072001436,  5.632304604 },
4042           {    0.000214e-6,      639.897286314,  5.960227667 },
4043           {    0.000175e-6,     -433.711737877,  2.162417992 },
4044           {    0.000209e-6,      515.463871093,  2.322150893 },
4045           {    0.000173e-6,     6040.347246017,  2.556183691 },
4046           {    0.000184e-6,     6309.374169791,  4.732296790 },
4047           {    0.000227e-6,   149854.400134205,  5.385812217 },
4048        /* 751, 760 */
4049           {    0.000154e-6,     8031.092263058,  5.120720920 },
4050           {    0.000151e-6,     5739.157790895,  4.815000443 },
4051           {    0.000197e-6,     7632.943259650,  0.222827271 },
4052           {    0.000197e-6,       74.781598567,  3.910456770 },
4053           {    0.000138e-6,     6055.549660552,  1.397484253 },
4054           {    0.000149e-6,    -6127.655450557,  5.333727496 },
4055           {    0.000137e-6,     3894.181829542,  4.281749907 },
4056           {    0.000135e-6,     9437.762934887,  5.979971885 },
4057           {    0.000139e-6,    -2352.866153772,  4.715630782 },
4058           {    0.000142e-6,     6812.766815086,  0.513330157 },
4059        /* 761, 770 */
4060           {    0.000120e-6,    -4705.732307544,  0.194160689 },
4061           {    0.000131e-6,   -71430.695617928,  0.000379226 },
4062           {    0.000124e-6,     6279.552731642,  2.122264908 },
4063           {    0.000108e-6,    -6256.777530192,  0.883445696 },
4064 
4065        /* T^3 */
4066           {    0.143388e-6,     6283.075849991,  1.131453581 },
4067           {    0.006671e-6,    12566.151699983,  0.775148887 },
4068           {    0.001480e-6,      155.420399434,  0.480016880 },
4069           {    0.000934e-6,      213.299095438,  6.144453084 },
4070           {    0.000795e-6,      529.690965095,  2.941595619 },
4071           {    0.000673e-6,     5746.271337896,  0.120415406 },
4072        /* 771, 780 */
4073           {    0.000672e-6,     5760.498431898,  5.317009738 },
4074           {    0.000389e-6,     -220.412642439,  3.090323467 },
4075           {    0.000373e-6,     6062.663207553,  3.003551964 },
4076           {    0.000360e-6,     6076.890301554,  1.918913041 },
4077           {    0.000316e-6,      -21.340641002,  5.545798121 },
4078           {    0.000315e-6,     -242.728603974,  1.884932563 },
4079           {    0.000278e-6,      206.185548437,  1.266254859 },
4080           {    0.000238e-6,     -536.804512095,  4.532664830 },
4081           {    0.000185e-6,      522.577418094,  4.578313856 },
4082           {    0.000245e-6,    18849.227549974,  0.587467082 },
4083        /* 781, 787 */
4084           {    0.000180e-6,      426.598190876,  5.151178553 },
4085           {    0.000200e-6,      553.569402842,  5.355983739 },
4086           {    0.000141e-6,     5223.693919802,  1.336556009 },
4087           {    0.000104e-6,     5856.477659115,  4.239842759 },
4088 
4089        /* T^4 */
4090           {    0.003826e-6,     6283.075849991,  5.705257275 },
4091           {    0.000303e-6,    12566.151699983,  5.407132842 },
4092           {    0.000209e-6,      155.420399434,  1.989815753 }
4093        };
4094 
4095 
4096     /* Time since J2000.0 in Julian millennia. */
4097        t = ((date1 - DJ00) + date2) / DJM;
4098 
4099     /* ================= */
4100     /* Topocentric terms */
4101     /* ================= */
4102 
4103     /* Convert UT to local solar time in radians. */
4104        tsol = fmod(ut, 1.0) * D2PI + elong;
4105 
4106     /* FUNDAMENTAL ARGUMENTS:  Simon et al. 1994. */
4107 
4108     /* Combine time argument (millennia) with deg/arcsec factor. */
4109        w = t / 3600.0;
4110 
4111     /* Sun Mean Longitude. */
4112        elsun = fmod(280.46645683 + 1296027711.03429 * w, 360.0) * DD2R;
4113 
4114     /* Sun Mean Anomaly. */
4115        emsun = fmod(357.52910918 + 1295965810.481 * w, 360.0) * DD2R;
4116 
4117     /* Mean Elongation of Moon from Sun. */
4118        d = fmod(297.85019547 + 16029616012.090 * w, 360.0) * DD2R;
4119 
4120     /* Mean Longitude of Jupiter. */
4121        elj = fmod(34.35151874 + 109306899.89453 * w, 360.0) * DD2R;
4122 
4123     /* Mean Longitude of Saturn. */
4124        els = fmod(50.07744430 + 44046398.47038 * w, 360.0) * DD2R;
4125 
4126     /* TOPOCENTRIC TERMS:  Moyer 1981 and Murray 1983. */
4127        wt =   +  0.00029e-10 * u * sin(tsol + elsun - els)
4128               +  0.00100e-10 * u * sin(tsol - 2.0 * emsun)
4129               +  0.00133e-10 * u * sin(tsol - d)
4130               +  0.00133e-10 * u * sin(tsol + elsun - elj)
4131               -  0.00229e-10 * u * sin(tsol + 2.0 * elsun + emsun)
4132               -  0.02200e-10 * v * cos(elsun + emsun)
4133               +  0.05312e-10 * u * sin(tsol - emsun)
4134               -  0.13677e-10 * u * sin(tsol + 2.0 * elsun)
4135               -  1.31840e-10 * v * cos(elsun)
4136               +  3.17679e-10 * u * sin(tsol);
4137 
4138     /* ===================== */
4139     /* Fairhead et al. model */
4140     /* ===================== */
4141 
4142     /* T**0 */
4143        w0 = 0;
4144        for (j = 473; j >= 0; j--) {
4145           w0 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4146        }
4147 
4148     /* T**1 */
4149        w1 = 0;
4150        for (j = 678; j >= 474; j--) {
4151           w1 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4152        }
4153 
4154     /* T**2 */
4155        w2 = 0;
4156        for (j = 763; j >= 679; j--) {
4157           w2 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4158        }
4159 
4160     /* T**3 */
4161        w3 = 0;
4162        for (j = 783; j >= 764; j--) {
4163           w3 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4164        }
4165 
4166     /* T**4 */
4167        w4 = 0;
4168        for (j = 786; j >= 784; j--) {
4169           w4 += fairhd[j][0] * sin(fairhd[j][1] * t + fairhd[j][2]);
4170        }
4171 
4172     /* Multiply by powers of T and combine. */
4173        wf = t * (t * (t * (t * w4 + w3) + w2) + w1) + w0;
4174 
4175     /* Adjustments to use JPL planetary masses instead of IAU. */
4176        wj =   0.00065e-6 * sin(6069.776754 * t + 4.021194) +
4177               0.00033e-6 * sin( 213.299095 * t + 5.543132) +
4178             (-0.00196e-6 * sin(6208.294251 * t + 5.696701)) +
4179             (-0.00173e-6 * sin(  74.781599 * t + 2.435900)) +
4180               0.03638e-6 * t * t;
4181 
4182     /* ============ */
4183     /* Final result */
4184     /* ============ */
4185 
4186     /* TDB-TT in seconds. */
4187        w = wt + wf + wj;
4188 
4189        return w;
4190 
4191         }
4192     
4193 
4194     /**
4195     *  The equation of the equinoxes, compatible with IAU 2000 resolutions,
4196     *  given the nutation in longitude and the mean obliquity.
4197     *
4198     *<p>This function is derived from the International Astronomical Union's
4199     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4200     *
4201     *<p>Status:  canonical model.
4202     *
4203     *<!-- Given: -->
4204     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4205     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4206     *     @param epsa          double     mean obliquity (Note 2)
4207     *     @param dpsi          double     nutation in longitude (Note 3)
4208     *
4209     * <!-- Returned (function value): -->
4210     *  @return double    equation of the equinoxes (Note 4)
4211     *
4212     * <p>Notes:
4213     * <ol>
4214     *
4215     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4216     *     convenient way between the two arguments.  For example,
4217     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4218     *     among others:
4219     *<pre>
4220     *            date1          date2
4221     *
4222     *         2450123.7           0.0       (JD method)
4223     *         2451545.0       -1421.3       (J2000 method)
4224     *         2400000.5       50123.2       (MJD method)
4225     *         2450123.5           0.2       (date &amp; time method)
4226     *</pre>
4227     *     The JD method is the most natural and convenient to use in
4228     *     cases where the loss of several decimal digits of resolution
4229     *     is acceptable.  The J2000 method is best matched to the way
4230     *     the argument is handled internally and will deliver the
4231     *     optimum resolution.  The MJD method and the date &amp; time methods
4232     *     are both good compromises between resolution and convenience.
4233     *
4234     * <li> The obliquity, in radians, is mean of date.
4235     *
4236     * <li> The result, which is in radians, operates in the following sense:
4237     *
4238     *        Greenwich apparent ST = GMST + equation of the equinoxes
4239     *
4240     * <li> The result is compatible with the IAU 2000 resolutions.  For
4241     *     further details, see IERS Conventions 2003 and Capitaine et al.
4242     *     (2002).
4243     *</ol>
4244     *<p>Called:<ul>
4245     *     <li>{@link #jauEect00} equation of the equinoxes complementary terms
4246     * </ul>
4247     *
4248     *
4249     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4250     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4251     *     Astrophysics, 406, 1135-1149 (2003)
4252     *
4253     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4254     *     IERS Technical Note No. 32, BKG (2004)
4255     *
4256     *@version 2008 May 16
4257     *
4258     *  @since Release 20101201
4259     *
4260     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4261     */
4262     public static double jauEe00(double date1, double date2, double epsa, double dpsi)
4263     {
4264        double ee;
4265 
4266 
4267     /* Equation of the equinoxes. */
4268        ee = dpsi * cos(epsa) + jauEect00(date1, date2);
4269 
4270        return ee;
4271 
4272         }
4273     
4274 
4275     /**
4276     *  Equation of the equinoxes, compatible with IAU 2000 resolutions.
4277     *
4278     *<p>This function is derived from the International Astronomical Union's
4279     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4280     *
4281     *<p>Status:  support function.
4282     *
4283     *<!-- Given: -->
4284     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4285     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4286     *
4287     * <!-- Returned (function value): -->
4288     *  @return double    equation of the equinoxes (Note 2)
4289     *
4290     * <p>Notes:
4291     * <ol>
4292     *
4293     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4294     *     convenient way between the two arguments.  For example,
4295     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4296     *     among others:
4297     *<pre>
4298     *            date1          date2
4299     *
4300     *         2450123.7           0.0       (JD method)
4301     *         2451545.0       -1421.3       (J2000 method)
4302     *         2400000.5       50123.2       (MJD method)
4303     *         2450123.5           0.2       (date &amp; time method)
4304     *</pre>
4305     *     The JD method is the most natural and convenient to use in
4306     *     cases where the loss of several decimal digits of resolution
4307     *     is acceptable.  The J2000 method is best matched to the way
4308     *     the argument is handled internally and will deliver the
4309     *     optimum resolution.  The MJD method and the date &amp; time methods
4310     *     are both good compromises between resolution and convenience.
4311     *
4312     * <li> The result, which is in radians, operates in the following sense:
4313     *
4314     *        Greenwich apparent ST = GMST + equation of the equinoxes
4315     *
4316     * <li> The result is compatible with the IAU 2000 resolutions.  For
4317     *     further details, see IERS Conventions 2003 and Capitaine et al.
4318     *     (2002).
4319     *</ol>
4320     *<p>Called:<ul>
4321     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4322     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4323     *     <li>{@link #jauNut00a} nutation, IAU 2000A
4324     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4325     * </ul>
4326     *<p>References:
4327     *
4328     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4329     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4330     *     Astrophysics, 406, 1135-1149 (2003).
4331     *
4332     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4333     *     IERS Technical Note No. 32, BKG (2004).
4334     *
4335     *@version 2008 May 16
4336     *
4337     *  @since Release 20101201
4338     *
4339     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4340     */
4341     public static double jauEe00a(double date1, double date2)
4342     {
4343        double epsa,  ee;
4344 
4345 
4346     /* IAU 2000 precession-rate adjustments. */
4347        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4348 
4349     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4350        epsa = jauObl80(date1, date2) + nutd.depspr;
4351 
4352     /* Nutation in longitude. */
4353        NutationTerms nut = jauNut00a(date1, date2);
4354 
4355     /* Equation of the equinoxes. */
4356        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4357 
4358        return ee;
4359 
4360         }
4361     
4362 
4363     /**
4364     *  Equation of the equinoxes, compatible with IAU 2000 resolutions but
4365     *  using the truncated nutation model IAU 2000B.
4366     *
4367     *<p>This function is derived from the International Astronomical Union's
4368     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4369     *
4370     *<p>Status:  support function.
4371     *
4372     *<!-- Given: -->
4373     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4374     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4375     *
4376     * <!-- Returned (function value): -->
4377     *  @return double    equation of the equinoxes (Note 2)
4378     *
4379     * <p>Notes:
4380     * <ol>
4381     *
4382     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4383     *     convenient way between the two arguments.  For example,
4384     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4385     *     among others:
4386     *<pre>
4387     *            date1          date2
4388     *
4389     *         2450123.7           0.0       (JD method)
4390     *         2451545.0       -1421.3       (J2000 method)
4391     *         2400000.5       50123.2       (MJD method)
4392     *         2450123.5           0.2       (date &amp; time method)
4393     *</pre>
4394     *     The JD method is the most natural and convenient to use in
4395     *     cases where the loss of several decimal digits of resolution
4396     *     is acceptable.  The J2000 method is best matched to the way
4397     *     the argument is handled internally and will deliver the
4398     *     optimum resolution.  The MJD method and the date &amp; time methods
4399     *     are both good compromises between resolution and convenience.
4400     *
4401     * <li> The result, which is in radians, operates in the following sense:
4402     *
4403     *        Greenwich apparent ST = GMST + equation of the equinoxes
4404     *
4405     * <li> The result is compatible with the IAU 2000 resolutions except
4406     *     that accuracy has been compromised for the sake of speed.  For
4407     *     further details, see McCarthy &amp; Luzum (2001), IERS Conventions
4408     *     2003 and Capitaine et al. (2003).
4409     *</ol>
4410     *<p>Called:<ul>
4411     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
4412     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
4413     *     <li>{@link #jauNut00b} nutation, IAU 2000B
4414     *     <li>{@link #jauEe00} equation of the equinoxes, IAU 2000
4415     * </ul>
4416     *
4417     *
4418     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4419     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4420     *     Astrophysics, 406, 1135-1149 (2003)
4421     *
4422     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
4423     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
4424     *     Dynamical Astronomy, 85, 37-49 (2003)
4425     *
4426     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4427     *     IERS Technical Note No. 32, BKG (2004)
4428     *
4429     *@version 2008 May 18
4430     *
4431     *  @since Release 20101201
4432     *
4433     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4434     */
4435     public static  double jauEe00b(double date1, double date2)
4436     {
4437        double  ee;
4438 
4439 
4440     /* IAU 2000 precession-rate adjustments. */
4441        PrecessionDeltaTerms nutd = jauPr00(date1, date2);
4442 
4443     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
4444        double epsa = jauObl80(date1, date2) + nutd.depspr;
4445 
4446     /* Nutation in longitude. dpsi, deps*/
4447        NutationTerms nut = jauNut00b(date1, date2 );
4448 
4449     /* Equation of the equinoxes. */
4450        ee = jauEe00(date1, date2, epsa, nut.dpsi);
4451 
4452        return ee;
4453 
4454         }
4455  
4456     /**
4457     *  Equation of the equinoxes, compatible with IAU 2000 resolutions and
4458     *  IAU 2006/2000A precession-nutation.
4459     *
4460     *<p>This function is derived from the International Astronomical Union's
4461     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4462     *
4463     *<p>Status:  support function.
4464     *
4465     *<!-- Given: -->
4466     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4467     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4468     *
4469     * <!-- Returned (function value): -->
4470     *  @return double    equation of the equinoxes (Note 2)
4471     *
4472     * <p>Notes:
4473     * <ol>
4474     *
4475     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4476     *     convenient way between the two arguments.  For example,
4477     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4478     *     among others:
4479     *<pre>
4480     *            date1          date2
4481     *
4482     *         2450123.7           0.0       (JD method)
4483     *         2451545.0       -1421.3       (J2000 method)
4484     *         2400000.5       50123.2       (MJD method)
4485     *         2450123.5           0.2       (date &amp; time method)
4486     *</pre>
4487     *     The JD method is the most natural and convenient to use in
4488     *     cases where the loss of several decimal digits of resolution
4489     *     is acceptable.  The J2000 method is best matched to the way
4490     *     the argument is handled internally and will deliver the
4491     *     optimum resolution.  The MJD method and the date &amp; time methods
4492     *     are both good compromises between resolution and convenience.
4493     *
4494     * <li> The result, which is in radians, operates in the following sense:
4495     *
4496     *        Greenwich apparent ST = GMST + equation of the equinoxes
4497     *</ol>
4498     *<p>Called:<ul>
4499     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
4500     *     <li>{@link #jauGst06a} Greenwich apparent sidereal time, IAU 2006/2000A
4501     *     <li>{@link #jauGmst06} Greenwich mean sidereal time, IAU 2006
4502     * </ul>
4503     *<p>Reference:
4504     *
4505     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
4506     *     IERS Technical Note No. 32, BKG
4507     *
4508     *@version 2008 May 18
4509     *
4510     *  @since Release 20101201
4511     *
4512     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4513     */
4514     public static double jauEe06a(double date1, double date2)
4515     {
4516        double gst06a, gmst06, ee;
4517 
4518 
4519     /* Apparent and mean sidereal times. */
4520        gst06a = jauGst06a(0.0, 0.0, date1, date2);
4521        gmst06 = jauGmst06(0.0, 0.0, date1, date2);
4522 
4523     /* Equation of the equinoxes. */
4524        ee  = jauAnpm(gst06a - gmst06);
4525 
4526        return ee;
4527 
4528         }
4529  
4530     private static class TERM {
4531         final int nfa[];      /* coefficients of l,l',F,D,Om,LVe,LE,pA */
4532         final double s, c;     /* sine and cosine coefficients */
4533         public TERM(int nfa[], double s, double c) {
4534             this.nfa = nfa;
4535             this.s = s;
4536             this.c = c;
4537         }
4538        
4539      } 
4540 
4541 
4542     /**
4543     *  Equation of the equinoxes complementary terms, consistent with
4544     *  IAU 2000 resolutions.
4545     *
4546     *<p>This function is derived from the International Astronomical Union's
4547     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4548     *
4549     *<p>Status:  canonical model.
4550     *
4551     *<!-- Given: -->
4552     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4553     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4554     *
4555     * <!-- Returned (function value): -->
4556     *  @return double   complementary terms (Note 2)
4557     *
4558     * <p>Notes:
4559     * <ol>
4560     *
4561     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4562     *     convenient way between the two arguments.  For example,
4563     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4564     *     among others:
4565     *<pre>
4566     *            date1          date2
4567     *
4568     *         2450123.7           0.0       (JD method)
4569     *         2451545.0       -1421.3       (J2000 method)
4570     *         2400000.5       50123.2       (MJD method)
4571     *         2450123.5           0.2       (date &amp; time method)
4572     *</pre>
4573     *     The JD method is the most natural and convenient to use in
4574     *     cases where the loss of several decimal digits of resolution
4575     *     is acceptable.  The J2000 method is best matched to the way
4576     *     the argument is handled internally and will deliver the
4577     *     optimum resolution.  The MJD method and the date &amp; time methods
4578     *     are both good compromises between resolution and convenience.
4579     *
4580     * <li> The "complementary terms" are part of the equation of the
4581     *     equinoxes (EE), classically the difference between apparent and
4582     *     mean Sidereal Time:
4583     *
4584     *        GAST = GMST + EE
4585     *
4586     *     with:
4587     *
4588     *        EE = dpsi * cos(eps)
4589     *
4590     *     where dpsi is the nutation in longitude and eps is the obliquity
4591     *     of date.  However, if the rotation of the Earth were constant in
4592     *     an inertial frame the classical formulation would lead to
4593     *     apparent irregularities in the UT1 timescale traceable to side-
4594     *     effects of precession-nutation.  In order to eliminate these
4595     *     effects from UT1, "complementary terms" were introduced in 1994
4596     *     (IAU, 1994) and took effect from 1997 (Capitaine and Gontier,
4597     * <li>:
4598     *
4599     *        GAST = GMST + CT + EE
4600     *
4601     *     By convention, the complementary terms are included as part of
4602     *     the equation of the equinoxes rather than as part of the mean
4603     *     Sidereal Time.  This slightly compromises the "geometrical"
4604     *     interpretation of mean sidereal time but is otherwise
4605     *     inconsequential.
4606     *
4607     *     The present function computes CT in the above expression,
4608     *     compatible with IAU 2000 resolutions (Capitaine et al., 2002, and
4609     *     IERS Conventions 2003).
4610     *</ol>
4611     *<p>Called:<ul>
4612     *     <li>{@link #jauFal03} mean anomaly of the Moon
4613     *     <li>{@link #jauFalp03} mean anomaly of the Sun
4614     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
4615     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
4616     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
4617     *     <li>{@link #jauFave03} mean longitude of Venus
4618     *     <li>{@link #jauFae03} mean longitude of Earth
4619     *     <li>{@link #jauFapa03} general accumulated precession in longitude
4620     * </ul>
4621     *<p>References:
4622     *
4623     *     <p>Capitaine, N. &amp; Gontier, A.-M., Astron. Astrophys., 275,
4624     *     645-650 (1993)
4625     *
4626     *     <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
4627     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
4628     *     Astrophysics, 406, 1135-1149 (2003)
4629     *
4630     *     <p>IAU Resolution C7, Recommendation 3 (1994)
4631     *
4632     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
4633     *     IERS Technical Note No. 32, BKG (2004)
4634     *
4635     *@version 2009 December 17
4636     *
4637     *  @since Release 20101201
4638     *
4639     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4640     */
4641     public static double jauEect00(double date1, double date2)
4642     {
4643     /* Time since J2000.0, in Julian centuries */
4644        double t;
4645 
4646     /* Miscellaneous */
4647        int i, j;
4648        double a, s0, s1;
4649 
4650     /* Fundamental arguments */
4651        double fa[] = new double[14];
4652 
4653     /* Returned value. */
4654        double eect;
4655 
4656     /* ----------------------------------------- */
4657     /* The series for the EE complementary terms */
4658     /* ----------------------------------------- */
4659 
4660 
4661     /* Terms of order t^0 */
4662        final TERM e0[] = {
4663 
4664        /* 1-10 */
4665           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, 2640.96e-6, -0.39e-6 ),
4666           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   63.52e-6, -0.02e-6 ),
4667           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   11.75e-6,  0.01e-6 ),
4668           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   11.21e-6,  0.01e-6 ),
4669           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},   -4.55e-6,  0.00e-6 ),
4670           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    2.02e-6,  0.00e-6 ),
4671           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    1.98e-6,  0.00e-6 ),
4672           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},   -1.72e-6,  0.00e-6 ),
4673           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},   -1.41e-6, -0.01e-6 ),
4674           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},   -1.26e-6, -0.01e-6 ),
4675 
4676        /* 11-20 */
4677           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4678           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},   -0.63e-6,  0.00e-6 ),
4679           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    0.46e-6,  0.00e-6 ),
4680           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    0.45e-6,  0.00e-6 ),
4681           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    0.36e-6,  0.00e-6 ),
4682           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},   -0.24e-6, -0.12e-6 ),
4683           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    0.32e-6,  0.00e-6 ),
4684           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    0.28e-6,  0.00e-6 ),
4685           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    0.27e-6,  0.00e-6 ),
4686           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    0.26e-6,  0.00e-6 ),
4687 
4688        /* 21-30 */
4689           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},   -0.21e-6,  0.00e-6 ),
4690           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    0.19e-6,  0.00e-6 ),
4691           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    0.18e-6,  0.00e-6 ),
4692           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},   -0.10e-6,  0.05e-6 ),
4693           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    0.15e-6,  0.00e-6 ),
4694           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4695           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4696           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},   -0.14e-6,  0.00e-6 ),
4697           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    0.14e-6,  0.00e-6 ),
4698           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    0.13e-6,  0.00e-6 ),
4699 
4700        /* 31-33 */
4701           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},   -0.11e-6,  0.00e-6 ),
4702           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    0.11e-6,  0.00e-6 ),
4703           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    0.11e-6,  0.00e-6 )
4704        };
4705 
4706     /* Terms of order t^1 */
4707        final TERM e1[] = {
4708           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.87e-6,  0.00e-6 )
4709        };
4710 
4711     /* Number of terms in the series */
4712        final int NE0 = e0.length;
4713        final int NE1 = e1.length;
4714 
4715     /*--------------------------------------------------------------------*/
4716 
4717     /* Interval between fundamental epoch J2000.0 and current date (JC). */
4718        t = ((date1 - DJ00) + date2) / DJC;
4719 
4720     /* Fundamental Arguments (from IERS Conventions 2003) */
4721 
4722     /* Mean anomaly of the Moon. */
4723        fa[0] = jauFal03(t);
4724 
4725     /* Mean anomaly of the Sun. */
4726        fa[1] = jauFalp03(t);
4727 
4728     /* Mean longitude of the Moon minus that of the ascending node. */
4729        fa[2] = jauFaf03(t);
4730 
4731     /* Mean elongation of the Moon from the Sun. */
4732        fa[3] = jauFad03(t);
4733 
4734     /* Mean longitude of the ascending node of the Moon. */
4735        fa[4] = jauFaom03(t);
4736 
4737     /* Mean longitude of Venus. */
4738        fa[5] = jauFave03(t);
4739 
4740     /* Mean longitude of Earth. */
4741        fa[6] = jauFae03(t);
4742 
4743     /* General precession in longitude. */
4744        fa[7] = jauFapa03(t);
4745 
4746     /* Evaluate the EE complementary terms. */
4747        s0 = 0.0;
4748        s1 = 0.0;
4749 
4750        for (i = NE0-1; i >= 0; i--) {
4751           a = 0.0;
4752           for (j = 0; j < 8; j++) {
4753              a += (double)(e0[i].nfa[j]) * fa[j];
4754           }
4755           s0 += e0[i].s * sin(a) + e0[i].c * cos(a);
4756        }
4757 
4758        for (i = NE1-1; i >= 0; i--) {
4759           a = 0.0;
4760           for (j = 0; j < 8; j++) {
4761              a += (double)(e1[i].nfa[j]) * fa[j];
4762           }
4763           s1 += e1[i].s * sin(a) + e1[i].c * cos(a);
4764        }
4765 
4766        eect = (s0 + s1 * t ) * DAS2R;
4767 
4768        return eect;
4769 
4770         }
4771     
4772     /**
4773      * Reference Ellipsoid of Earth.
4774      * 
4775      * The ellipsoid parameters are returned in the form of equatorial
4776     *     radius in meters (a) and flattening (f).  The latter is a number
4777     *     around 0.00335, i.e. around 1/298.
4778     *
4779      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
4780      * 
4781      * @since AIDA Stage 1
4782      */
4783     public static class ReferenceEllipsoid{
4784         /** equatorial radius (meters, Note 2) */
4785         public double a; 
4786         /** flattening (Note 2) */
4787         public double f ;
4788         public ReferenceEllipsoid(double a, double f ) {
4789             this.a = a;
4790             this.f = f;
4791         }
4792     }
4793     /**
4794     *  Earth reference ellipsoids.
4795     *
4796     *<p>This function is derived from the International Astronomical Union's
4797     *  JSOFA (Standards of Fundamental Astronomy) software collection.
4798     *
4799     *<p>Status:  canonical.
4800     *
4801     *<!-- Given: -->
4802     *     @param n        int       ellipsoid identifier (Note 1)
4803     *
4804     *<!-- Returned: -->
4805     *     @return  a        double     <u>returned</u> equatorial radius (meters, Note 2)
4806     *              f        double     <u>returned</u> flattening (Note 2)
4807     *
4808     * <!-- Returned (function value): -->
4809     *  @throws JSOFAIllegalParameter
4810     *                     int       status:
4811     *                          0 = OK
4812     *                         -1 = illegal identifier (Note 3)
4813     *
4814     * <p>Notes:
4815     * <ol>
4816     *
4817     * <li> The identifier n is a number that specifies the choice of
4818     *     reference ellipsoid.  The following are supported:
4819     *
4820     *        n   ellipsoid
4821     *
4822     *        1    WGS84
4823     *        2    GRS80
4824     *        3    WGS72
4825     *
4826     *     The number n has no significance outside the JSOFA software.
4827     *
4828     * <li> The ellipsoid parameters are returned in the form of equatorial
4829     *     radius in meters (a) and flattening (f).  The latter is a number
4830     *     around 0.00335, i.e. around 1/298.
4831     *
4832     * <li> For the case where an unsupported n value is supplied, zero a and
4833     *     f are returned, as well as error status.
4834     *</ol>
4835     *<p>References:
4836     *
4837     *     <p>Department of Defense World Geodetic System 1984, National
4838     *     Imagery and Mapping Agency Technical Report 8350.2, Third
4839     *     Edition, p3-2.
4840     *
4841     *     <p>Moritz, H., Bull. Geodesique 66-2, 187 (1992).
4842     *
4843     *     <p>The Department of Defense World Geodetic System 1972, World
4844     *     Geodetic System Committee, May 1974.
4845     *
4846     *     <p>Explanatory Supplement to the Astronomical Almanac,
4847     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
4848     *     p220.
4849     *
4850     *@version 2010 January 18
4851     *
4852     *  @since Release 20101201
4853     *
4854     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4855     */
4856     public static  ReferenceEllipsoid jauEform ( int n ) throws JSOFAIllegalParameter
4857     {
4858       double a,f;
4859     /* Look up a and f for the specified reference ellipsoid. */
4860        switch ( n ) {
4861        case 1:
4862 
4863        /* WGS84. */
4864           a = 6378137.0;
4865           f = 1.0 / 298.257223563;
4866           break;
4867 
4868        case 2:
4869 
4870        /* GRS80. */
4871           a = 6378137.0;
4872           f = 1.0 / 298.257222101;
4873           break;
4874 
4875        case 3:
4876 
4877        /* WGS72. */
4878           a = 6378135.0;
4879           f = 1.0 / 298.26;
4880           break;
4881 
4882        default:
4883 
4884        /* Invalid identifier. */
4885           a = 0.0;
4886           f = 0.0;
4887           throw new JSOFAIllegalParameter("illegal ellipsoid identifier", -1);
4888 
4889        }
4890 
4891     /* OK status. */
4892        return new ReferenceEllipsoid(a, f);
4893 
4894     
4895     }
4896     
4897 
4898     /**
4899     *  Equation of the origins, IAU 2006 precession and IAU 2000A nutation.
4900     *
4901     *<p>This function is derived from the International Astronomical Union's
4902     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4903     *
4904     *<p>Status:  support function.
4905     *
4906     *<!-- Given: -->
4907     *     @param date1 double TT as a 2-part Julian Date (Note 1)
4908     *     @param date2 double TT as a 2-part Julian Date (Note 1)
4909     *
4910     * <!-- Returned (function value): -->
4911     *  @return double    equation of the origins in radians
4912     *
4913     * <p>Notes:
4914     * <ol>
4915     *
4916     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
4917     *     convenient way between the two arguments.  For example,
4918     *     JD(TT)=2450123.7 could be expressed in any of these ways,
4919     *     among others:
4920     *<pre>
4921     *            date1          date2
4922     *
4923     *         2450123.7           0.0       (JD method)
4924     *         2451545.0       -1421.3       (J2000 method)
4925     *         2400000.5       50123.2       (MJD method)
4926     *         2450123.5           0.2       (date &amp; time method)
4927     *</pre>
4928     *     The JD method is the most natural and convenient to use in
4929     *     cases where the loss of several decimal digits of resolution
4930     *     is acceptable.  The J2000 method is best matched to the way
4931     *     the argument is handled internally and will deliver the
4932     *     optimum resolution.  The MJD method and the date &amp; time methods
4933     *     are both good compromises between resolution and convenience.
4934     *
4935     * <li> The equation of the origins is the distance between the true
4936     *     equinox and the celestial intermediate origin and, equivalently,
4937     *     the difference between Earth rotation angle and Greenwich
4938     *     apparent sidereal time (ERA-GST).  It comprises the precession
4939     *     (since J2000.0) in right ascension plus the equation of the
4940     *     equinoxes (including the small correction terms).
4941     *</ol>
4942     *<p>Called:<ul>
4943     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
4944     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
4945     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
4946     *     <li>{@link #jauEors} equation of the origins, Given NPB matrix and s
4947     * </ul>
4948     *<p>References:
4949     *
4950     *     <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
4951     *
4952     *     <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
4953     *
4954     *@version 2008 May 16
4955     *
4956     *  @since Release 20101201
4957     *
4958     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
4959     */
4960     public static double jauEo06a(double date1, double date2)
4961     {
4962        double r[][], s, eo;
4963 
4964 
4965     /* Classical nutation x precession x bias matrix. */
4966        r = jauPnm06a(date1, date2);
4967 
4968     /* Extract CIP coordinates. */
4969        CelestialIntermediatePole cip = jauBpn2xy(r);
4970 
4971     /* The CIO locator, s. */
4972        s = jauS06(date1, date2, cip.x, cip.y);
4973 
4974     /* Solve for the EO. */
4975        eo = jauEors(r, s);
4976 
4977        return eo;
4978 
4979         }
4980     
4981 
4982     /**
4983     *  Equation of the origins, given the classical NPB matrix and the
4984     *  quantity s.
4985     *
4986     *<p>This function is derived from the International Astronomical Union's
4987     *  SOFA (Standards Of Fundamental Astronomy) software collection.
4988     *
4989     *<p>Status:  support function.
4990     *
4991     *<!-- Given: -->
4992     *     @param rnpb   double[3][3]   classical nutation x precession x bias matrix
4993     *     @param s      double         the quantity s (the CIO locator)
4994     *
4995     * <!-- Returned (function value): -->
4996     *  @return double        the equation of the origins in radians.
4997     *
4998     * <p>Notes:
4999     * <ol>
5000     *
5001     * <li>  The equation of the origins is the distance between the true
5002     *      equinox and the celestial intermediate origin and, equivalently,
5003     *      the difference between Earth rotation angle and Greenwich
5004     *      apparent sidereal time (ERA-GST).  It comprises the precession
5005     *      (since J2000.0) in right ascension plus the equation of the
5006     *      equinoxes (including the small correction terms).
5007     *
5008     * <li>  The algorithm is from Wallace &amp; Capitaine (2006).
5009     *</ol>
5010     * References:
5011     *
5012     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
5013     *
5014     *    <p>Wallace, P. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
5015     *
5016     *@version 2008 May 26
5017     *
5018     *  @since Release 20101201
5019     *
5020     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5021     */
5022     public static double jauEors(double rnpb[][], double s)
5023     {
5024        double x, ax, xs, ys, zs, p, q, eo;
5025 
5026 
5027     /* Evaluate Wallace &amp; Capitaine (2006) expression (16). */
5028        x = rnpb[2][0];
5029        ax = x / (1.0 + rnpb[2][2]);
5030        xs = 1.0 - ax * x;
5031        ys = -ax * rnpb[2][1];
5032        zs = -x;
5033        p = rnpb[0][0] * xs + rnpb[0][1] * ys + rnpb[0][2] * zs;
5034        q = rnpb[1][0] * xs + rnpb[1][1] * ys + rnpb[1][2] * zs;
5035        eo = ((p != 0) || (q != 0)) ? s - atan2(q, p) : s;
5036 
5037        return eo;
5038 
5039         }
5040     
5041 
5042     /**
5043     *  Julian Date to Besselian Epoch.
5044     *
5045     *<p>This function is derived from the International Astronomical Union's
5046     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5047     *
5048     *<p>Status:  support function.
5049     *
5050     *<!-- Given: -->
5051     *     @param dj1 double      Julian Date (see note)
5052     *     @param dj2 double      Julian Date (see note) 
5053     *
5054     * <!-- Returned (function value): -->
5055     *  @return double     Besselian Epoch.
5056     *
5057     *  Note:
5058     *
5059     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5060     *     manner, which is designed to preserve time resolution.  The
5061     *     Julian Date is available as a single number by adding dj1 and
5062     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5063     *     (J2000.0).
5064     *
5065     *<p>Reference:
5066     *
5067     *     Lieske,J.H., 1979. Astron.Astrophys.,73,282.
5068     *
5069     *@version 2009 December 16
5070     *
5071     *  @since Release 20101201
5072     *
5073     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5074     */
5075     public static double jauEpb(double dj1, double dj2)
5076     {
5077     /* J2000.0 minus B1900.0 (2415019.81352) in Julian days */
5078        final double D1900 = 36524.68648;
5079 
5080        return 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
5081 
5082         }
5083     
5084     /**
5085     *  Besselian Epoch to Julian Date.
5086     *
5087     *<p>This function is derived from the International Astronomical Union's
5088     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5089     *
5090     *<p>Status:  support function.
5091     *
5092     *<!-- Given: -->
5093     *     @param epb       double     Besselian Epoch (e.g. 1957.3D0)
5094     *
5095     *<!-- Returned: -->
5096     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5097     *
5098     *  Note:
5099     *
5100     *     The Julian Date is returned in two pieces, in the usual JSOFA
5101     *     manner, which is designed to preserve time resolution.  The
5102     *     Julian Date is available as a single number by adding djm0 and
5103     *     djm.
5104     *
5105     *<p>Reference:
5106     *
5107     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5108     *
5109     *@version 2008 May 24
5110     *
5111     *  @since Release 20101201
5112     *
5113     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5114     */
5115     public static JulianDate jauEpb2jd(double epb)
5116     {
5117         double djm0, djm;
5118        djm0 = 2400000.5;
5119        djm  =   15019.81352 + (epb - 1900.0) * DTY;
5120 
5121        return new JulianDate(djm0, djm);
5122 
5123         }
5124     
5125 
5126     /**
5127     *  Julian Date to Julian Epoch.
5128     *
5129     *<p>This function is derived from the International Astronomical Union's
5130     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5131     *
5132     *<p>Status:  support function.
5133     *
5134     *<!-- Given: -->
5135     *     @param dj1 double      Julian Date (see note)
5136     *     @param dj2 double      Julian Date (see note) 
5137     *
5138     * <!-- Returned (function value): -->
5139     *  @return double     Julian Epoch
5140     *
5141     *  Note:
5142     *
5143     *     The Julian Date is supplied in two pieces, in the usual JSOFA
5144     *     manner, which is designed to preserve time resolution.  The
5145     *     Julian Date is available as a single number by adding dj1 and
5146     *     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
5147     *     (J2000.0).
5148     *
5149     *<p>Reference:
5150     *
5151     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5152     *
5153     *@version 2009 December 16
5154     *
5155     *  @since Release 20101201
5156     *
5157     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5158     */
5159     public static double jauEpj(double dj1, double dj2)
5160     {
5161        return 2000.0 + ((dj1 - DJ00) + dj2) / DJY;
5162 
5163      }
5164     
5165 
5166     /**
5167     *  Julian Epoch to Julian Date.
5168     *
5169     *<p>This function is derived from the International Astronomical Union's
5170     *  SOFA (Standards Of Fundamental Astronomy) software collection.
5171     *
5172     *<p>Status:  support function.
5173     *
5174     *<!-- Given: -->
5175     *     @param epj       double     Julian Epoch (e.g. 1996.8D0)
5176     *
5177     *<!-- Returned: -->
5178     *     @return  MJD zero-point: always 2400000.5  Modified Julian Date
5179     *
5180     *  Note:
5181     *
5182     *     The Julian Date is returned in two pieces, in the usual JSOFA
5183     *     manner, which is designed to preserve time resolution.  The
5184     *     Julian Date is available as a single number by adding djm0 and
5185     *     djm.
5186     *
5187     *<p>Reference:
5188     *
5189     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
5190     *
5191     *@version 2008 May 11
5192     *
5193     *  @since Release 20101201
5194     *
5195     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
5196     */
5197     public static JulianDate jauEpj2jd(double epj)
5198     {
5199        double djm0, djm;
5200        djm0 = 2400000.5;
5201        djm  =   51544.5 + (epj - 2000.0) * 365.25;
5202 
5203        return new JulianDate(djm0, djm);
5204 
5205         }
5206     
5207 
5208     /*
5209      * A utility class to get round 65536 byte limit on functions in java - The static initializer is too large on its own. - So split into two classes for no real semantic reason
5210      */        
5211     static private final class Ephemeris extends SSB {
5212        
5213 
5214     /**
5215     * ----------------------
5216     * Ephemeris Coefficients
5217     * ----------------------
5218     *
5219     * The ephemeris consists of harmonic terms for predicting (i) the Sun
5220     * to Earth vector and (ii) the Solar-System-barycenter to Sun vector
5221     * respectively.  The coefficients are stored in arrays which, although
5222     * 1-demensional, contain groups of three.  Each triplet of
5223     * coefficients is the amplitude, phase and frequency for one term in
5224     * the model, and each array contains the number of terms called for by
5225     * the model.
5226     *
5227     * There are eighteen such arrays, named as follows:
5228     *<pre>
5229     *     array         model      power of T      component
5230     *
5231     *      e0x      Sun-to-Earth        0              x
5232     *      e0y      Sun-to-Earth        0              y
5233     *      e0z      Sun-to-Earth        0              z
5234     *
5235     *      e1x      Sun-to-Earth        1              x
5236     *      e1y      Sun-to-Earth        1              y
5237     *      e1z      Sun-to-Earth        1              z
5238     *
5239     *      e2x      Sun-to-Earth        2              x
5240     *      e2y      Sun-to-Earth        2              y
5241     *      e2z      Sun-to-Earth        2              z
5242     *
5243     *      s0x      SSB-to-Sun          0              x
5244     *      s0y      SSB-to-Sun          0              y
5245     *      s0z      SSB-to-Sun          0              z
5246     *
5247     *      s1x      SSB-to-Sun          1              x
5248     *      s1y      SSB-to-Sun          1              y
5249     *      s1z      SSB-to-Sun          1              z
5250     *
5251     *      s2x      SSB-to-Sun          2              x
5252     *      s2y      SSB-to-Sun          2              y
5253     *      s2z      SSB-to-Sun          2              z
5254     *<pre>
5255     */
5256 
5257     /* Sun-to-Earth, T^0, X */
5258       static final double e0x[] = {
5259           0.9998292878132e+00, 0.1753485171504e+01, 0.6283075850446e+01,
5260           0.8352579567414e-02, 0.1710344404582e+01, 0.1256615170089e+02,
5261           0.5611445335148e-02, 0.0000000000000e+00, 0.0000000000000e+00,
5262           0.1046664295572e-03, 0.1667225416770e+01, 0.1884922755134e+02,
5263           0.3110842534677e-04, 0.6687513390251e+00, 0.8399684731857e+02,
5264           0.2552413503550e-04, 0.5830637358413e+00, 0.5296909721118e+00,
5265           0.2137207845781e-04, 0.1092330954011e+01, 0.1577343543434e+01,
5266           0.1680240182951e-04, 0.4955366134987e+00, 0.6279552690824e+01,
5267           0.1679012370795e-04, 0.6153014091901e+01, 0.6286599010068e+01,
5268           0.1445526946777e-04, 0.3472744100492e+01, 0.2352866153506e+01,
5269 
5270           0.1091038246184e-04, 0.3689845786119e+01, 0.5223693906222e+01,
5271           0.9344399733932e-05, 0.6073934645672e+01, 0.1203646072878e+02,
5272           0.8993182910652e-05, 0.3175705249069e+01, 0.1021328554739e+02,
5273           0.5665546034116e-05, 0.2152484672246e+01, 0.1059381944224e+01,
5274           0.6844146703035e-05, 0.1306964099750e+01, 0.5753384878334e+01,
5275           0.7346610905565e-05, 0.4354980070466e+01, 0.3981490189893e+00,
5276           0.6815396474414e-05, 0.2218229211267e+01, 0.4705732307012e+01,
5277           0.6112787253053e-05, 0.5384788425458e+01, 0.6812766822558e+01,
5278           0.4518120711239e-05, 0.6087604012291e+01, 0.5884926831456e+01,
5279           0.4521963430706e-05, 0.1279424524906e+01, 0.6256777527156e+01,
5280 
5281           0.4497426764085e-05, 0.5369129144266e+01, 0.6309374173736e+01,
5282           0.4062190566959e-05, 0.5436473303367e+00, 0.6681224869435e+01,
5283           0.5412193480192e-05, 0.7867838528395e+00, 0.7755226100720e+00,
5284           0.5469839049386e-05, 0.1461440311134e+01, 0.1414349524433e+02,
5285           0.5205264083477e-05, 0.4432944696116e+01, 0.7860419393880e+01,
5286           0.2149759935455e-05, 0.4502237496846e+01, 0.1150676975667e+02,
5287           0.2279109618501e-05, 0.1239441308815e+01, 0.7058598460518e+01,
5288           0.2259282939683e-05, 0.3272430985331e+01, 0.4694002934110e+01,
5289           0.2558950271319e-05, 0.2265471086404e+01, 0.1216800268190e+02,
5290           0.2561581447555e-05, 0.1454740653245e+01, 0.7099330490126e+00,
5291 
5292           0.1781441115440e-05, 0.2962068630206e+01, 0.7962980379786e+00,
5293           0.1612005874644e-05, 0.1473255041006e+01, 0.5486777812467e+01,
5294           0.1818630667105e-05, 0.3743903293447e+00, 0.6283008715021e+01,
5295           0.1818601377529e-05, 0.6274174354554e+01, 0.6283142985870e+01,
5296           0.1554475925257e-05, 0.1624110906816e+01, 0.2513230340178e+02,
5297           0.2090948029241e-05, 0.5852052276256e+01, 0.1179062909082e+02,
5298           0.2000176345460e-05, 0.4072093298513e+01, 0.1778984560711e+02,
5299           0.1289535917759e-05, 0.5217019331069e+01, 0.7079373888424e+01,
5300           0.1281135307881e-05, 0.4802054538934e+01, 0.3738761453707e+01,
5301           0.1518229005692e-05, 0.8691914742502e+00, 0.2132990797783e+00,
5302 
5303           0.9450128579027e-06, 0.4601859529950e+01, 0.1097707878456e+02,
5304           0.7781119494996e-06, 0.1844352816694e+01, 0.8827390247185e+01,
5305           0.7733407759912e-06, 0.3582790154750e+01, 0.5507553240374e+01,
5306           0.7350644318120e-06, 0.2695277788230e+01, 0.1589072916335e+01,
5307           0.6535928827023e-06, 0.3651327986142e+01, 0.1176985366291e+02,
5308           0.6324624183656e-06, 0.2241302375862e+01, 0.6262300422539e+01,
5309           0.6298565300557e-06, 0.4407122406081e+01, 0.6303851278352e+01,
5310           0.8587037089179e-06, 0.3024307223119e+01, 0.1672837615881e+03,
5311           0.8299954491035e-06, 0.6192539428237e+01, 0.3340612434717e+01,
5312           0.6311263503401e-06, 0.2014758795416e+01, 0.7113454667900e-02,
5313 
5314           0.6005646745452e-06, 0.3399500503397e+01, 0.4136910472696e+01,
5315           0.7917715109929e-06, 0.2493386877837e+01, 0.6069776770667e+01,
5316           0.7556958099685e-06, 0.4159491740143e+01, 0.6496374930224e+01,
5317           0.6773228244949e-06, 0.4034162934230e+01, 0.9437762937313e+01,
5318           0.5370708577847e-06, 0.1562219163734e+01, 0.1194447056968e+01,
5319           0.5710804266203e-06, 0.2662730803386e+01, 0.6282095334605e+01,
5320           0.5709824583726e-06, 0.3985828430833e+01, 0.6284056366286e+01,
5321           0.5143950896447e-06, 0.1308144688689e+01, 0.6290189305114e+01,
5322           0.5088010604546e-06, 0.5352817214804e+01, 0.6275962395778e+01,
5323           0.4960369085172e-06, 0.2644267922349e+01, 0.6127655567643e+01,
5324 
5325           0.4803137891183e-06, 0.4008844192080e+01, 0.6438496133249e+01,
5326           0.5731747768225e-06, 0.3794550174597e+01, 0.3154687086868e+01,
5327           0.4735947960579e-06, 0.6107118308982e+01, 0.3128388763578e+01,
5328           0.4808348796625e-06, 0.4771458618163e+01, 0.8018209333619e+00,
5329           0.4115073743137e-06, 0.3327111335159e+01, 0.8429241228195e+01,
5330           0.5230575889287e-06, 0.5305708551694e+01, 0.1336797263425e+02,
5331           0.5133977889215e-06, 0.5784230738814e+01, 0.1235285262111e+02,
5332           0.5065815825327e-06, 0.2052064793679e+01, 0.1185621865188e+02,
5333           0.4339831593868e-06, 0.3644994195830e+01, 0.1726015463500e+02,
5334           0.3952928638953e-06, 0.4930376436758e+01, 0.5481254917084e+01,
5335 
5336           0.4898498111942e-06, 0.4542084219731e+00, 0.9225539266174e+01,
5337           0.4757490209328e-06, 0.3161126388878e+01, 0.5856477690889e+01,
5338           0.4727701669749e-06, 0.6214993845446e+00, 0.2544314396739e+01,
5339           0.3800966681863e-06, 0.3040132339297e+01, 0.4265981595566e+00,
5340           0.3257301077939e-06, 0.8064977360087e+00, 0.3930209696940e+01,
5341           0.3255810528674e-06, 0.1974147981034e+01, 0.2146165377750e+01,
5342           0.3252029748187e-06, 0.2845924913135e+01, 0.4164311961999e+01,
5343           0.3255505635308e-06, 0.3017900824120e+01, 0.5088628793478e+01,
5344           0.2801345211990e-06, 0.6109717793179e+01, 0.1256967486051e+02,
5345           0.3688987740970e-06, 0.2911550235289e+01, 0.1807370494127e+02,
5346 
5347           0.2475153429458e-06, 0.2179146025856e+01, 0.2629832328990e-01,
5348           0.3033457749150e-06, 0.1994161050744e+01, 0.4535059491685e+01,
5349           0.2186743763110e-06, 0.5125687237936e+01, 0.1137170464392e+02,
5350           0.2764777032774e-06, 0.4822646860252e+00, 0.1256262854127e+02,
5351           0.2199028768592e-06, 0.4637633293831e+01, 0.1255903824622e+02,
5352           0.2046482824760e-06, 0.1467038733093e+01, 0.7084896783808e+01,
5353           0.2611209147507e-06, 0.3044718783485e+00, 0.7143069561767e+02,
5354           0.2286079656818e-06, 0.4764220356805e+01, 0.8031092209206e+01,
5355           0.1855071202587e-06, 0.3383637774428e+01, 0.1748016358760e+01,
5356           0.2324669506784e-06, 0.6189088449251e+01, 0.1831953657923e+02,
5357 
5358           0.1709528015688e-06, 0.5874966729774e+00, 0.4933208510675e+01,
5359           0.2168156875828e-06, 0.4302994009132e+01, 0.1044738781244e+02,
5360           0.2106675556535e-06, 0.3800475419891e+01, 0.7477522907414e+01,
5361           0.1430213830465e-06, 0.1294660846502e+01, 0.2942463415728e+01,
5362           0.1388396901944e-06, 0.4594797202114e+01, 0.8635942003952e+01,
5363           0.1922258844190e-06, 0.4943044543591e+00, 0.1729818233119e+02,
5364           0.1888460058292e-06, 0.2426943912028e+01, 0.1561374759853e+03,
5365           0.1789449386107e-06, 0.1582973303499e+00, 0.1592596075957e+01,
5366           0.1360803685374e-06, 0.5197240440504e+01, 0.1309584267300e+02,
5367           0.1504038014709e-06, 0.3120360916217e+01, 0.1649636139783e+02,
5368 
5369           0.1382769533389e-06, 0.6164702888205e+01, 0.7632943190217e+01,
5370           0.1438059769079e-06, 0.1437423770979e+01, 0.2042657109477e+02,
5371           0.1326303260037e-06, 0.3609688799679e+01, 0.1213955354133e+02,
5372           0.1159244950540e-06, 0.5463018167225e+01, 0.5331357529664e+01,
5373           0.1433118149136e-06, 0.6028909912097e+01, 0.7342457794669e+01,
5374           0.1234623148594e-06, 0.3109645574997e+01, 0.6279485555400e+01,
5375           0.1233949875344e-06, 0.3539359332866e+01, 0.6286666145492e+01,
5376           0.9927196061299e-07, 0.1259321569772e+01, 0.7234794171227e+01,
5377           0.1242302191316e-06, 0.1065949392609e+01, 0.1511046609763e+02,
5378           0.1098402195201e-06, 0.2192508743837e+01, 0.1098880815746e+02,
5379 
5380           0.1158191395315e-06, 0.4054411278650e+01, 0.5729506548653e+01,
5381           0.9048475596241e-07, 0.5429764748518e+01, 0.9623688285163e+01,
5382           0.8889853269023e-07, 0.5046586206575e+01, 0.6148010737701e+01,
5383           0.1048694242164e-06, 0.2628858030806e+01, 0.6836645152238e+01,
5384           0.1112308378646e-06, 0.4177292719907e+01, 0.1572083878776e+02,
5385           0.8631729709901e-07, 0.1601345232557e+01, 0.6418140963190e+01,
5386           0.8527816951664e-07, 0.2463888997513e+01, 0.1471231707864e+02,
5387           0.7892139456991e-07, 0.3154022088718e+01, 0.2118763888447e+01,
5388           0.1051782905236e-06, 0.4795035816088e+01, 0.1349867339771e+01,
5389           0.1048219943164e-06, 0.2952983395230e+01, 0.5999216516294e+01,
5390 
5391           0.7435760775143e-07, 0.5420547991464e+01, 0.6040347114260e+01,
5392           0.9869574106949e-07, 0.3695646753667e+01, 0.6566935184597e+01,
5393           0.9156886364226e-07, 0.3922675306609e+01, 0.5643178611111e+01,
5394           0.7006834356188e-07, 0.1233968624861e+01, 0.6525804586632e+01,
5395           0.9806170182601e-07, 0.1919542280684e+01, 0.2122839202813e+02,
5396           0.9052289673607e-07, 0.4615902724369e+01, 0.4690479774488e+01,
5397           0.7554200867893e-07, 0.1236863719072e+01, 0.1253985337760e+02,
5398           0.8215741286498e-07, 0.3286800101559e+00, 0.1097355562493e+02,
5399           0.7185178575397e-07, 0.5880942158367e+01, 0.6245048154254e+01,
5400           0.7130726476180e-07, 0.7674871987661e+00, 0.6321103546637e+01,
5401 
5402           0.6650894461162e-07, 0.6987129150116e+00, 0.5327476111629e+01,
5403           0.7396888823688e-07, 0.3576824794443e+01, 0.5368044267797e+00,
5404           0.7420588884775e-07, 0.5033615245369e+01, 0.2354323048545e+02,
5405           0.6141181642908e-07, 0.9449927045673e+00, 0.1296430071988e+02,
5406           0.6373557924058e-07, 0.6206342280341e+01, 0.9517183207817e+00,
5407           0.6359474329261e-07, 0.5036079095757e+01, 0.1990745094947e+01,
5408           0.5740173582646e-07, 0.6105106371350e+01, 0.9555997388169e+00,
5409           0.7019864084602e-07, 0.7237747359018e+00, 0.5225775174439e+00,
5410           0.6398054487042e-07, 0.3976367969666e+01, 0.2407292145756e+02,
5411           0.7797092650498e-07, 0.4305423910623e+01, 0.2200391463820e+02,
5412 
5413           0.6466760000900e-07, 0.3500136825200e+01, 0.5230807360890e+01,
5414           0.7529417043890e-07, 0.3514779246100e+01, 0.1842262939178e+02,
5415           0.6924571140892e-07, 0.2743457928679e+01, 0.1554202828031e+00,
5416           0.6220798650222e-07, 0.2242598118209e+01, 0.1845107853235e+02,
5417           0.5870209391853e-07, 0.2332832707527e+01, 0.6398972393349e+00,
5418           0.6263953473888e-07, 0.2191105358956e+01, 0.6277552955062e+01,
5419           0.6257781390012e-07, 0.4457559396698e+01, 0.6288598745829e+01,
5420           0.5697304945123e-07, 0.3499234761404e+01, 0.1551045220144e+01,
5421           0.6335438746791e-07, 0.6441691079251e+00, 0.5216580451554e+01,
5422           0.6377258441152e-07, 0.2252599151092e+01, 0.5650292065779e+01,
5423 
5424           0.6484841818165e-07, 0.1992812417646e+01, 0.1030928125552e+00,
5425           0.4735551485250e-07, 0.3744672082942e+01, 0.1431416805965e+02,
5426           0.4628595996170e-07, 0.1334226211745e+01, 0.5535693017924e+00,
5427           0.6258152336933e-07, 0.4395836159154e+01, 0.2608790314060e+02,
5428           0.6196171366594e-07, 0.2587043007997e+01, 0.8467247584405e+02,
5429           0.6159556952126e-07, 0.4782499769128e+01, 0.2394243902548e+03,
5430           0.4987741172394e-07, 0.7312257619924e+00, 0.7771377146812e+02,
5431           0.5459280703142e-07, 0.3001376372532e+01, 0.6179983037890e+01,
5432           0.4863461189999e-07, 0.3767222128541e+01, 0.9027992316901e+02,
5433           0.5349912093158e-07, 0.3663594450273e+01, 0.6386168663001e+01,
5434 
5435           0.5673725607806e-07, 0.4331187919049e+01, 0.6915859635113e+01,
5436           0.4745485060512e-07, 0.5816195745518e+01, 0.6282970628506e+01,
5437           0.4745379005326e-07, 0.8323672435672e+00, 0.6283181072386e+01,
5438           0.4049002796321e-07, 0.3785023976293e+01, 0.6254626709878e+01,
5439           0.4247084014515e-07, 0.2378220728783e+01, 0.7875671926403e+01,
5440           0.4026912363055e-07, 0.2864103423269e+01, 0.6311524991013e+01,
5441           0.4062935011774e-07, 0.2415408595975e+01, 0.3634620989887e+01,
5442           0.5347771048509e-07, 0.3343479309801e+01, 0.2515860172507e+02,
5443           0.4829494136505e-07, 0.2821742398262e+01, 0.5760498333002e+01,
5444           0.4342554404599e-07, 0.5624662458712e+01, 0.7238675589263e+01,
5445 
5446           0.4021599184361e-07, 0.5557250275009e+00, 0.1101510648075e+02,
5447           0.4104900474558e-07, 0.3296691780005e+01, 0.6709674010002e+01,
5448           0.4376532905131e-07, 0.3814443999443e+01, 0.6805653367890e+01,
5449           0.3314590480650e-07, 0.3560229189250e+01, 0.1259245002418e+02,
5450           0.3232421839643e-07, 0.5185389180568e+01, 0.1066495398892e+01,
5451           0.3541176318876e-07, 0.3921381909679e+01, 0.9917696840332e+01,
5452           0.3689831242681e-07, 0.4190658955386e+01, 0.1192625446156e+02,
5453           0.3890605376774e-07, 0.5546023371097e+01, 0.7478166569050e-01,
5454           0.3038559339780e-07, 0.6231032794494e+01, 0.1256621883632e+02,
5455           0.3137083969782e-07, 0.6207063419190e+01, 0.4292330755499e+01,
5456 
5457           0.4024004081854e-07, 0.1195257375713e+01, 0.1334167431096e+02,
5458           0.3300234879283e-07, 0.1804694240998e+01, 0.1057540660594e+02,
5459           0.3635399155575e-07, 0.5597811343500e+01, 0.6208294184755e+01,
5460           0.3032668691356e-07, 0.3191059366530e+01, 0.1805292951336e+02,
5461           0.2809652069058e-07, 0.4094348032570e+01, 0.3523159621801e-02,
5462           0.3696955383823e-07, 0.5219282738794e+01, 0.5966683958112e+01,
5463           0.3562894142503e-07, 0.1037247544554e+01, 0.6357857516136e+01,
5464           0.3510598524148e-07, 0.1430020816116e+01, 0.6599467742779e+01,
5465           0.3617736142953e-07, 0.3002911403677e+01, 0.6019991944201e+01,
5466           0.2624524910730e-07, 0.2437046757292e+01, 0.6702560555334e+01,
5467 
5468           0.2535824204490e-07, 0.1581594689647e+01, 0.3141537925223e+02,
5469           0.3519787226257e-07, 0.5379863121521e+01, 0.2505706758577e+03,
5470           0.2578406709982e-07, 0.4904222639329e+01, 0.1673046366289e+02,
5471           0.3423887981473e-07, 0.3646448997315e+01, 0.6546159756691e+01,
5472           0.2776083886467e-07, 0.3307829300144e+01, 0.1272157198369e+02,
5473           0.3379592818379e-07, 0.1747541251125e+01, 0.1494531617769e+02,
5474           0.3050255426284e-07, 0.1784689432607e-01, 0.4732030630302e+01,
5475           0.2652378350236e-07, 0.4420055276260e+01, 0.5863591145557e+01,
5476           0.2374498173768e-07, 0.3629773929208e+01, 0.2388894113936e+01,
5477           0.2716451255140e-07, 0.3079623706780e+01, 0.1202934727411e+02,
5478 
5479           0.3038583699229e-07, 0.3312487903507e+00, 0.1256608456547e+02,
5480           0.2220681228760e-07, 0.5265520401774e+01, 0.1336244973887e+02,
5481           0.3044156540912e-07, 0.4766664081250e+01, 0.2908881142201e+02,
5482           0.2731859923561e-07, 0.5069146530691e+01, 0.1391601904066e+02,
5483           0.2285603018171e-07, 0.5954935112271e+01, 0.6076890225335e+01,
5484           0.2025006454555e-07, 0.4061789589267e+01, 0.4701116388778e+01,
5485           0.2012597519804e-07, 0.2485047705241e+01, 0.6262720680387e+01,
5486           0.2003406962258e-07, 0.4163779209320e+01, 0.6303431020504e+01,
5487           0.2207863441371e-07, 0.6923839133828e+00, 0.6489261475556e+01,
5488           0.2481374305624e-07, 0.5944173595676e+01, 0.1204357418345e+02,
5489 
5490           0.2130923288870e-07, 0.4641013671967e+01, 0.5746271423666e+01,
5491           0.2446370543391e-07, 0.6125796518757e+01, 0.1495633313810e+00,
5492           0.1932492759052e-07, 0.2234572324504e+00, 0.1352175143971e+02,
5493           0.2600122568049e-07, 0.4281012405440e+01, 0.4590910121555e+01,
5494           0.2431754047488e-07, 0.1429943874870e+00, 0.1162474756779e+01,
5495           0.1875902869209e-07, 0.9781803816948e+00, 0.6279194432410e+01,
5496           0.1874381139426e-07, 0.5670368130173e+01, 0.6286957268481e+01,
5497           0.2156696047173e-07, 0.2008985006833e+01, 0.1813929450232e+02,
5498           0.1965076182484e-07, 0.2566186202453e+00, 0.4686889479442e+01,
5499           0.2334816372359e-07, 0.4408121891493e+01, 0.1002183730415e+02,
5500 
5501           0.1869937408802e-07, 0.5272745038656e+01, 0.2427287361862e+00,
5502           0.2436236460883e-07, 0.4407720479029e+01, 0.9514313292143e+02,
5503           0.1761365216611e-07, 0.1943892315074e+00, 0.1351787002167e+02,
5504           0.2156289480503e-07, 0.1418570924545e+01, 0.6037244212485e+01,
5505           0.2164748979255e-07, 0.4724603439430e+01, 0.2301353951334e+02,
5506           0.2222286670853e-07, 0.2400266874598e+01, 0.1266924451345e+02,
5507           0.2070901414929e-07, 0.5230348028732e+01, 0.6528907488406e+01,
5508           0.1792745177020e-07, 0.2099190328945e+01, 0.6819880277225e+01,
5509           0.1841802068445e-07, 0.3467527844848e+00, 0.6514761976723e+02,
5510           0.1578401631718e-07, 0.7098642356340e+00, 0.2077542790660e-01,
5511 
5512           0.1561690152531e-07, 0.5943349620372e+01, 0.6272439236156e+01,
5513           0.1558591045463e-07, 0.7040653478980e+00, 0.6293712464735e+01,
5514           0.1737356469576e-07, 0.4487064760345e+01, 0.1765478049437e+02,
5515           0.1434755619991e-07, 0.2993391570995e+01, 0.1102062672231e+00,
5516           0.1482187806654e-07, 0.2278049198251e+01, 0.1052268489556e+01,
5517           0.1424812827089e-07, 0.1682114725827e+01, 0.1311972100268e+02,
5518           0.1380282448623e-07, 0.3262668602579e+01, 0.1017725758696e+02,
5519           0.1811481244566e-07, 0.3187771221777e+01, 0.1887552587463e+02,
5520           0.1504446185696e-07, 0.5650162308647e+01, 0.7626583626240e-01,
5521           0.1740776154137e-07, 0.5487068607507e+01, 0.1965104848470e+02,
5522 
5523           0.1374339536251e-07, 0.5745688172201e+01, 0.6016468784579e+01,
5524           0.1761377477704e-07, 0.5748060203659e+01, 0.2593412433514e+02,
5525           0.1535138225795e-07, 0.6226848505790e+01, 0.9411464614024e+01,
5526           0.1788140543676e-07, 0.6189318878563e+01, 0.3301902111895e+02,
5527           0.1375002807996e-07, 0.5371812884394e+01, 0.6327837846670e+00,
5528           0.1242115758632e-07, 0.1471687569712e+01, 0.3894181736510e+01,
5529           0.1450977333938e-07, 0.4143836662127e+01, 0.1277945078067e+02,
5530           0.1297579575023e-07, 0.9003477661957e+00, 0.6549682916313e+01,
5531           0.1462667934821e-07, 0.5760505536428e+01, 0.1863592847156e+02,
5532           0.1381774374799e-07, 0.1085471729463e+01, 0.2379164476796e+01,
5533 
5534           0.1682333169307e-07, 0.5409870870133e+01, 0.1620077269078e+02,
5535           0.1190812918837e-07, 0.1397205174601e+01, 0.1149965630200e+02,
5536           0.1221434762106e-07, 0.9001804809095e+00, 0.1257326515556e+02,
5537           0.1549934644860e-07, 0.4262528275544e+01, 0.1820933031200e+02,
5538           0.1252138953050e-07, 0.1411642012027e+01, 0.6993008899458e+01,
5539           0.1237078905387e-07, 0.2844472403615e+01, 0.2435678079171e+02,
5540           0.1446953389615e-07, 0.5295835522223e+01, 0.3813291813120e-01,
5541           0.1388446457170e-07, 0.4969428135497e+01, 0.2458316379602e+00,
5542           0.1019339179228e-07, 0.2491369561806e+01, 0.6112403035119e+01,
5543           0.1258880815343e-07, 0.4679426248976e+01, 0.5429879531333e+01,
5544 
5545           0.1297768238261e-07, 0.1074509953328e+01, 0.1249137003520e+02,
5546           0.9913505718094e-08, 0.4735097918224e+01, 0.6247047890016e+01,
5547           0.9830453155969e-08, 0.4158649187338e+01, 0.6453748665772e+01,
5548           0.1192615865309e-07, 0.3438208613699e+01, 0.6290122169689e+01,
5549           0.9835874798277e-08, 0.1913300781229e+01, 0.6319103810876e+01,
5550           0.9639087569277e-08, 0.9487683644125e+00, 0.8273820945392e+01,
5551           0.1175716107001e-07, 0.3228141664287e+01, 0.6276029531202e+01,
5552           0.1018926508678e-07, 0.2216607854300e+01, 0.1254537627298e+02,
5553           0.9500087869225e-08, 0.2625116459733e+01, 0.1256517118505e+02,
5554           0.9664192916575e-08, 0.5860562449214e+01, 0.6259197520765e+01,
5555 
5556           0.9612858712203e-08, 0.7885682917381e+00, 0.6306954180126e+01,
5557           0.1117645675413e-07, 0.3932148831189e+01, 0.1779695906178e+02,
5558           0.1158864052160e-07, 0.9995605521691e+00, 0.1778273215245e+02,
5559           0.9021043467028e-08, 0.5263769742673e+01, 0.6172869583223e+01,
5560           0.8836134773563e-08, 0.1496843220365e+01, 0.1692165728891e+01,
5561           0.1045872200691e-07, 0.7009039517214e+00, 0.2204125344462e+00,
5562           0.1211463487798e-07, 0.4041544938511e+01, 0.8257698122054e+02,
5563           0.8541990804094e-08, 0.1447586692316e+01, 0.6393282117669e+01,
5564           0.1038720703636e-07, 0.4594249718112e+00, 0.1550861511662e+02,
5565           0.1126722351445e-07, 0.3925550579036e+01, 0.2061856251104e+00,
5566 
5567           0.8697373859631e-08, 0.4411341856037e+01, 0.9491756770005e+00,
5568           0.8869380028441e-08, 0.2402659724813e+01, 0.3903911373650e+01,
5569           0.9247014693258e-08, 0.1401579743423e+01, 0.6267823317922e+01,
5570           0.9205062930950e-08, 0.5245978000814e+01, 0.6298328382969e+01,
5571           0.8000745038049e-08, 0.3590803356945e+01, 0.2648454860559e+01,
5572           0.9168973650819e-08, 0.2470150501679e+01, 0.1498544001348e+03,
5573           0.1075444949238e-07, 0.1328606161230e+01, 0.3694923081589e+02,
5574           0.7817298525817e-08, 0.6162256225998e+01, 0.4804209201333e+01,
5575           0.9541469226356e-08, 0.3942568967039e+01, 0.1256713221673e+02,
5576           0.9821910122027e-08, 0.2360246287233e+00, 0.1140367694411e+02,
5577 
5578           0.9897822023777e-08, 0.4619805634280e+01, 0.2280573557157e+02,
5579           0.7737289283765e-08, 0.3784727847451e+01, 0.7834121070590e+01,
5580           0.9260204034710e-08, 0.2223352487601e+01, 0.2787043132925e+01,
5581           0.7320252888486e-08, 0.1288694636874e+01, 0.6282655592598e+01,
5582           0.7319785780946e-08, 0.5359869567774e+01, 0.6283496108294e+01,
5583           0.7147219933778e-08, 0.5516616675856e+01, 0.1725663147538e+02,
5584           0.7946502829878e-08, 0.2630459984567e+01, 0.1241073141809e+02,
5585           0.9001711808932e-08, 0.2849815827227e+01, 0.6281591679874e+01,
5586           0.8994041507257e-08, 0.3795244450750e+01, 0.6284560021018e+01,
5587           0.8298582787358e-08, 0.5236413127363e+00, 0.1241658836951e+02,
5588 
5589           0.8526596520710e-08, 0.4794605424426e+01, 0.1098419223922e+02,
5590           0.8209822103197e-08, 0.1578752370328e+01, 0.1096996532989e+02,
5591           0.6357049861094e-08, 0.5708926113761e+01, 0.1596186371003e+01,
5592           0.7370473179049e-08, 0.3842402530241e+01, 0.4061219149443e+01,
5593           0.7232154664726e-08, 0.3067548981535e+01, 0.1610006857377e+03,
5594           0.6328765494903e-08, 0.1313930030069e+01, 0.1193336791622e+02,
5595           0.8030064908595e-08, 0.3488500408886e+01, 0.8460828644453e+00,
5596           0.6275464259232e-08, 0.1532061626198e+01, 0.8531963191132e+00,
5597           0.7051897446325e-08, 0.3285859929993e+01, 0.5849364236221e+01,
5598           0.6161593705428e-08, 0.1477341999464e+01, 0.5573142801433e+01,
5599 
5600           0.7754683957278e-08, 0.1586118663096e+01, 0.8662240327241e+01,
5601           0.5889928990701e-08, 0.1304887868803e+01, 0.1232342296471e+02,
5602           0.5705756047075e-08, 0.4555333589350e+01, 0.1258692712880e+02,
5603           0.5964178808332e-08, 0.3001762842062e+01, 0.5333900173445e+01,
5604           0.6712446027467e-08, 0.4886780007595e+01, 0.1171295538178e+02,
5605           0.5941809275464e-08, 0.4701509603824e+01, 0.9779108567966e+01,
5606           0.5466993627395e-08, 0.4588357817278e+01, 0.1884211409667e+02,
5607           0.6340512090980e-08, 0.1164543038893e+01, 0.5217580628120e+02,
5608           0.6325505710045e-08, 0.3919171259645e+01, 0.1041998632314e+02,
5609           0.6164789509685e-08, 0.2143828253542e+01, 0.6151533897323e+01,
5610 
5611           0.5263330812430e-08, 0.6066564434241e+01, 0.1885275071096e+02,
5612           0.5597087780221e-08, 0.2926316429472e+01, 0.4337116142245e+00,
5613           0.5396556236817e-08, 0.3244303591505e+01, 0.6286362197481e+01,
5614           0.5396615148223e-08, 0.3404304703662e+01, 0.6279789503410e+01,
5615           0.7091832443341e-08, 0.8532377803192e+00, 0.4907302013889e+01,
5616           0.6572352589782e-08, 0.4901966774419e+01, 0.1176433076753e+02,
5617           0.5960236060795e-08, 0.1874672315797e+01, 0.1422690933580e-01,
5618           0.5125480043511e-08, 0.3735726064334e+01, 0.1245594543367e+02,
5619           0.5928241866410e-08, 0.4502033899935e+01, 0.6414617803568e+01,
5620           0.5249600357424e-08, 0.4372334799878e+01, 0.1151388321134e+02,
5621 
5622           0.6059171276087e-08, 0.2581617302908e+01, 0.6062663316000e+01,
5623           0.5295235081662e-08, 0.2974811513158e+01, 0.3496032717521e+01,
5624           0.5820561875933e-08, 0.1796073748244e+00, 0.2838593341516e+00,
5625           0.4754696606440e-08, 0.1981998136973e+01, 0.3104930017775e+01,
5626           0.6385053548955e-08, 0.2559174171605e+00, 0.6133512519065e+01,
5627           0.6589828273941e-08, 0.2750967106776e+01, 0.4087944051283e+02,
5628           0.5383376567189e-08, 0.6325947523578e+00, 0.2248384854122e+02,
5629           0.5928941683538e-08, 0.1672304519067e+01, 0.1581959461667e+01,
5630           0.4816060709794e-08, 0.3512566172575e+01, 0.9388005868221e+01,
5631           0.6003381586512e-08, 0.5610932219189e+01, 0.5326786718777e+01,
5632 
5633           0.5504225393105e-08, 0.4037501131256e+01, 0.6503488384892e+01,
5634           0.5353772620129e-08, 0.6122774968240e+01, 0.1735668374386e+03,
5635           0.5786253768544e-08, 0.5527984999515e+01, 0.1350651127443e+00,
5636           0.5065706702002e-08, 0.9980765573624e+00, 0.1248988586463e+02,
5637           0.5972838885276e-08, 0.6044489493203e+01, 0.2673594526851e+02,
5638           0.5323585877961e-08, 0.3924265998147e+01, 0.4171425416666e+01,
5639           0.5210772682858e-08, 0.6220111376901e+01, 0.2460261242967e+02,
5640           0.4726549040535e-08, 0.3716043206862e+01, 0.7232251527446e+01,
5641           0.6029425105059e-08, 0.8548704071116e+00, 0.3227113045244e+03,
5642           0.4481542826513e-08, 0.1426925072829e+01, 0.5547199253223e+01,
5643 
5644           0.5836024505068e-08, 0.7135651752625e-01, 0.7285056171570e+02,
5645           0.4137046613272e-08, 0.5330767643283e+01, 0.1087398597200e+02,
5646           0.5171977473924e-08, 0.4494262335353e+00, 0.1884570439172e+02,
5647           0.5694429833732e-08, 0.2952369582215e+01, 0.9723862754494e+02,
5648           0.4009158925298e-08, 0.3500003416535e+01, 0.6244942932314e+01,
5649           0.4784939596873e-08, 0.6196709413181e+01, 0.2929661536378e+02,
5650           0.3983725022610e-08, 0.5103690031897e+01, 0.4274518229222e+01,
5651           0.3870535232462e-08, 0.3187569587401e+01, 0.6321208768577e+01,
5652           0.5140501213951e-08, 0.1668924357457e+01, 0.1232032006293e+02,
5653           0.3849034819355e-08, 0.4445722510309e+01, 0.1726726808967e+02,
5654 
5655           0.4002383075060e-08, 0.5226224152423e+01, 0.7018952447668e+01,
5656           0.3890719543549e-08, 0.4371166550274e+01, 0.1491901785440e+02,
5657           0.4887084607881e-08, 0.5973556689693e+01, 0.1478866649112e+01,
5658           0.3739939287592e-08, 0.2089084714600e+01, 0.6922973089781e+01,
5659           0.5031925918209e-08, 0.4658371936827e+01, 0.1715706182245e+02,
5660           0.4387748764954e-08, 0.4825580552819e+01, 0.2331413144044e+03,
5661           0.4147398098865e-08, 0.3739003524998e+01, 0.1376059875786e+02,
5662           0.3719089993586e-08, 0.1148941386536e+01, 0.6297302759782e+01,
5663           0.3934238461056e-08, 0.1559893008343e+01, 0.7872148766781e+01,
5664           0.3672471375622e-08, 0.5516145383612e+01, 0.6268848941110e+01,
5665 
5666           0.3768911277583e-08, 0.6116053700563e+01, 0.4157198507331e+01,
5667           0.4033388417295e-08, 0.5076821746017e+01, 0.1567108171867e+02,
5668           0.3764194617832e-08, 0.8164676232075e+00, 0.3185192151914e+01,
5669           0.4840628226284e-08, 0.1360479453671e+01, 0.1252801878276e+02,
5670           0.4949443923785e-08, 0.2725622229926e+01, 0.1617106187867e+03,
5671           0.4117393089971e-08, 0.6054459628492e+00, 0.5642198095270e+01,
5672           0.3925754020428e-08, 0.8570462135210e+00, 0.2139354194808e+02,
5673           0.3630551757923e-08, 0.3552067338279e+01, 0.6294805223347e+01,
5674           0.3627274802357e-08, 0.3096565085313e+01, 0.6271346477544e+01,
5675           0.3806143885093e-08, 0.6367751709777e+00, 0.1725304118033e+02,
5676 
5677           0.4433254641565e-08, 0.4848461503937e+01, 0.7445550607224e+01,
5678           0.3712319846576e-08, 0.1331950643655e+01, 0.4194847048887e+00,
5679           0.3849847534783e-08, 0.4958368297746e+00, 0.9562891316684e+00,
5680           0.3483955430165e-08, 0.2237215515707e+01, 0.1161697602389e+02,
5681           0.3961912730982e-08, 0.3332402188575e+01, 0.2277943724828e+02,
5682           0.3419978244481e-08, 0.5785600576016e+01, 0.1362553364512e+02,
5683           0.3329417758177e-08, 0.9812676559709e-01, 0.1685848245639e+02,
5684           0.4207206893193e-08, 0.9494780468236e+00, 0.2986433403208e+02,
5685           0.3268548976410e-08, 0.1739332095686e+00, 0.5749861718712e+01,
5686           0.3321880082685e-08, 0.1423354800666e+01, 0.6279143387820e+01,
5687 
5688           0.4503173010852e-08, 0.2314972675293e+00, 0.1385561574497e+01,
5689           0.4316599090954e-08, 0.1012646782616e+00, 0.4176041334900e+01,
5690           0.3283493323850e-08, 0.5233306881265e+01, 0.6287008313071e+01,
5691           0.3164033542343e-08, 0.4005597257511e+01, 0.2099539292909e+02,
5692           0.4159720956725e-08, 0.5365676242020e+01, 0.5905702259363e+01,
5693           0.3565176892217e-08, 0.4284440620612e+01, 0.3932462625300e-02,
5694           0.3514440950221e-08, 0.4270562636575e+01, 0.7335344340001e+01,
5695           0.3540596871909e-08, 0.5953553201060e+01, 0.1234573916645e+02,
5696           0.2960769905118e-08, 0.1115180417718e+01, 0.2670964694522e+02,
5697           0.2962213739684e-08, 0.3863811918186e+01, 0.6408777551755e+00,
5698 
5699           0.3883556700251e-08, 0.1268617928302e+01, 0.6660449441528e+01,
5700           0.2919225516346e-08, 0.4908605223265e+01, 0.1375773836557e+01,
5701           0.3115158863370e-08, 0.3744519976885e+01, 0.3802769619140e-01,
5702           0.4099438144212e-08, 0.4173244670532e+01, 0.4480965020977e+02,
5703           0.2899531858964e-08, 0.5910601428850e+01, 0.2059724391010e+02,
5704           0.3289733429855e-08, 0.2488050078239e+01, 0.1081813534213e+02,
5705           0.3933075612875e-08, 0.1122363652883e+01, 0.3773735910827e+00,
5706           0.3021403764467e-08, 0.4951973724904e+01, 0.2982630633589e+02,
5707           0.2798598949757e-08, 0.5117057845513e+01, 0.1937891852345e+02,
5708           0.3397421302707e-08, 0.6104159180476e+01, 0.6923953605621e+01,
5709 
5710           0.3720398002179e-08, 0.1184933429829e+01, 0.3066615496545e+02,
5711           0.3598484186267e-08, 0.3505282086105e+01, 0.6147450479709e+01,
5712           0.3694594027310e-08, 0.2286651088141e+01, 0.2636725487657e+01,
5713           0.2680444152969e-08, 0.1871816775482e+00, 0.6816289982179e+01,
5714           0.3497574865641e-08, 0.3143251755431e+01, 0.6418701221183e+01,
5715           0.3130274129494e-08, 0.2462167316018e+01, 0.1235996607578e+02,
5716           0.3241119069551e-08, 0.4256374004686e+01, 0.1652265972112e+02,
5717           0.2601960842061e-08, 0.4970362941425e+01, 0.1045450126711e+02,
5718           0.2690601527504e-08, 0.2372657824898e+01, 0.3163918923335e+00,
5719           0.2908688152664e-08, 0.4232652627721e+01, 0.2828699048865e+02,
5720 
5721           0.3120456131875e-08, 0.3925747001137e+00, 0.2195415756911e+02,
5722           0.3148855423384e-08, 0.3093478330445e+01, 0.1172006883645e+02,
5723           0.3051044261017e-08, 0.5560948248212e+01, 0.6055599646783e+01,
5724           0.2826006876660e-08, 0.5072790310072e+01, 0.5120601093667e+01,
5725           0.3100034191711e-08, 0.4998530231096e+01, 0.1799603123222e+02,
5726           0.2398771640101e-08, 0.2561739802176e+01, 0.6255674361143e+01,
5727           0.2384002842728e-08, 0.4087420284111e+01, 0.6310477339748e+01,
5728           0.2842146517568e-08, 0.2515048217955e+01, 0.5469525544182e+01,
5729           0.2847674371340e-08, 0.5235326497443e+01, 0.1034429499989e+02,
5730           0.2903722140764e-08, 0.1088200795797e+01, 0.6510552054109e+01,
5731 
5732           0.3187610710605e-08, 0.4710624424816e+01, 0.1693792562116e+03,
5733           0.3048869992813e-08, 0.2857975896445e+00, 0.8390110365991e+01,
5734           0.2860216950984e-08, 0.2241619020815e+01, 0.2243449970715e+00,
5735           0.2701117683113e-08, 0.6651573305272e-01, 0.6129297044991e+01,
5736           0.2509891590152e-08, 0.1285135324585e+01, 0.1044027435778e+02,
5737           0.2623200252223e-08, 0.2981229834530e+00, 0.6436854655901e+01,
5738           0.2622541669202e-08, 0.6122470726189e+01, 0.9380959548977e+01,
5739           0.2818435667099e-08, 0.4251087148947e+01, 0.5934151399930e+01,
5740           0.2365196797465e-08, 0.3465070460790e+01, 0.2470570524223e+02,
5741           0.2358704646143e-08, 0.5791603815350e+01, 0.8671969964381e+01,
5742 
5743           0.2388299481390e-08, 0.4142483772941e+01, 0.7096626156709e+01,
5744           0.1996041217224e-08, 0.2101901889496e+01, 0.1727188400790e+02,
5745           0.2687593060336e-08, 0.1526689456959e+01, 0.7075506709219e+02,
5746           0.2618913670810e-08, 0.2397684236095e+01, 0.6632000300961e+01,
5747           0.2571523050364e-08, 0.5751929456787e+00, 0.6206810014183e+01,
5748           0.2582135006946e-08, 0.5595464352926e+01, 0.4873985990671e+02,
5749           0.2372530190361e-08, 0.5092689490655e+01, 0.1590676413561e+02,
5750           0.2357178484712e-08, 0.4444363527851e+01, 0.3097883698531e+01,
5751           0.2451590394723e-08, 0.3108251687661e+01, 0.6612329252343e+00,
5752           0.2370045949608e-08, 0.2608133861079e+01, 0.3459636466239e+02,
5753 
5754           0.2268997267358e-08, 0.3639717753384e+01, 0.2844914056730e-01,
5755           0.1731432137906e-08, 0.1741898445707e+00, 0.2019909489111e+02,
5756           0.1629869741622e-08, 0.3902225646724e+01, 0.3035599730800e+02,
5757           0.2206215801974e-08, 0.4971131250731e+01, 0.6281667977667e+01,
5758           0.2205469554680e-08, 0.1677462357110e+01, 0.6284483723224e+01,
5759           0.2148792362509e-08, 0.4236259604006e+01, 0.1980482729015e+02,
5760           0.1873733657847e-08, 0.5926814998687e+01, 0.2876692439167e+02,
5761           0.2026573758959e-08, 0.4349643351962e+01, 0.2449240616245e+02,
5762           0.1807770325110e-08, 0.5700940482701e+01, 0.2045286941806e+02,
5763           0.1881174408581e-08, 0.6601286363430e+00, 0.2358125818164e+02,
5764 
5765           0.1368023671690e-08, 0.2211098592752e+01, 0.2473415438279e+02,
5766           0.1720017916280e-08, 0.4942488551129e+01, 0.1679593901136e+03,
5767           0.1702427665131e-08, 0.1452233856386e+01, 0.3338575901272e+03,
5768           0.1414032510054e-08, 0.5525357721439e+01, 0.1624205518357e+03,
5769           0.1652626045364e-08, 0.4108794283624e+01, 0.8956999012000e+02,
5770           0.1642957769686e-08, 0.7344335209984e+00, 0.5267006960365e+02,
5771           0.1614952403624e-08, 0.3541213951363e+01, 0.3332657872986e+02,
5772           0.1535988291188e-08, 0.4031094072151e+01, 0.3852657435933e+02,
5773           0.1593193738177e-08, 0.4185136203609e+01, 0.2282781046519e+03,
5774           0.1074569126382e-08, 0.1720485636868e+01, 0.8397383534231e+02,
5775 
5776           0.1074408214509e-08, 0.2758613420318e+01, 0.8401985929482e+02,
5777           0.9700199670465e-09, 0.4216686842097e+01, 0.7826370942180e+02,
5778           0.1258433517061e-08, 0.2575068876639e+00, 0.3115650189215e+03,
5779           0.1240303229539e-08, 0.4800844956756e+00, 0.1784300471910e+03,
5780           0.9018345948127e-09, 0.3896756361552e+00, 0.5886454391678e+02,
5781           0.1135301432805e-08, 0.3700805023550e+00, 0.7842370451713e+02,
5782           0.9215887951370e-09, 0.4364579276638e+01, 0.1014262087719e+03,
5783           0.1055401054147e-08, 0.2156564222111e+01, 0.5660027930059e+02,
5784           0.1008725979831e-08, 0.5454015785234e+01, 0.4245678405627e+02,
5785           0.7217398104321e-09, 0.1597772562175e+01, 0.2457074661053e+03,
5786 
5787           0.6912033134447e-09, 0.5824090621461e+01, 0.1679936946371e+03,
5788           0.6833881523549e-09, 0.3578778482835e+01, 0.6053048899753e+02,
5789           0.4887304205142e-09, 0.3724362812423e+01, 0.9656299901946e+02,
5790           0.5173709754788e-09, 0.5422427507933e+01, 0.2442876000072e+03,
5791           0.4671353097145e-09, 0.2396106924439e+01, 0.1435713242844e+03,
5792           0.5652608439480e-09, 0.2804028838685e+01, 0.8365903305582e+02,
5793           0.5604061331253e-09, 0.1638816006247e+01, 0.8433466158131e+02,
5794           0.4712723365400e-09, 0.8979003224474e+00, 0.3164282286739e+03,
5795           0.4909967465112e-09, 0.3210426725516e+01, 0.4059982187939e+03,
5796           0.4771358267658e-09, 0.5308027211629e+01, 0.1805255418145e+03,
5797 
5798           0.3943451445989e-09, 0.2195145341074e+01, 0.2568537517081e+03,
5799           0.3952109120244e-09, 0.5081189491586e+01, 0.2449975330562e+03,
5800           0.3788134594789e-09, 0.4345171264441e+01, 0.1568131045107e+03,
5801           0.3738330190479e-09, 0.2613062847997e+01, 0.3948519331910e+03,
5802           0.3099866678136e-09, 0.2846760817689e+01, 0.1547176098872e+03,
5803           0.2002962716768e-09, 0.4921360989412e+01, 0.2268582385539e+03,
5804           0.2198291338754e-09, 0.1130360117454e+00, 0.1658638954901e+03,
5805           0.1491958330784e-09, 0.4228195232278e+01, 0.2219950288015e+03,
5806           0.1475384076173e-09, 0.3005721811604e+00, 0.3052819430710e+03,
5807           0.1661626624624e-09, 0.7830125621203e+00, 0.2526661704812e+03,
5808 
5809           0.9015823460025e-10, 0.3807792942715e+01, 0.4171445043968e+03 };
5810 
5811     /* Sun-to-Earth, T^0, Y */
5812       static final double e0y[] = {
5813           0.9998921098898e+00, 0.1826583913846e+00, 0.6283075850446e+01,
5814          -0.2442700893735e-01, 0.0000000000000e+00, 0.0000000000000e+00,
5815           0.8352929742915e-02, 0.1395277998680e+00, 0.1256615170089e+02,
5816           0.1046697300177e-03, 0.9641423109763e-01, 0.1884922755134e+02,
5817           0.3110841876663e-04, 0.5381140401712e+01, 0.8399684731857e+02,
5818           0.2570269094593e-04, 0.5301016407128e+01, 0.5296909721118e+00,
5819           0.2147389623610e-04, 0.2662510869850e+01, 0.1577343543434e+01,
5820           0.1680344384050e-04, 0.5207904119704e+01, 0.6279552690824e+01,
5821           0.1679117312193e-04, 0.4582187486968e+01, 0.6286599010068e+01,
5822           0.1440512068440e-04, 0.1900688517726e+01, 0.2352866153506e+01,
5823 
5824           0.1135139664999e-04, 0.5273108538556e+01, 0.5223693906222e+01,
5825           0.9345482571018e-05, 0.4503047687738e+01, 0.1203646072878e+02,
5826           0.9007418719568e-05, 0.1605621059637e+01, 0.1021328554739e+02,
5827           0.5671536712314e-05, 0.5812849070861e+00, 0.1059381944224e+01,
5828           0.7451401861666e-05, 0.2807346794836e+01, 0.3981490189893e+00,
5829           0.6393470057114e-05, 0.6029224133855e+01, 0.5753384878334e+01,
5830           0.6814275881697e-05, 0.6472990145974e+00, 0.4705732307012e+01,
5831           0.6113705628887e-05, 0.3813843419700e+01, 0.6812766822558e+01,
5832           0.4503851367273e-05, 0.4527804370996e+01, 0.5884926831456e+01,
5833           0.4522249141926e-05, 0.5991783029224e+01, 0.6256777527156e+01,
5834 
5835           0.4501794307018e-05, 0.3798703844397e+01, 0.6309374173736e+01,
5836           0.5514927480180e-05, 0.3961257833388e+01, 0.5507553240374e+01,
5837           0.4062862799995e-05, 0.5256247296369e+01, 0.6681224869435e+01,
5838           0.5414900429712e-05, 0.5499032014097e+01, 0.7755226100720e+00,
5839           0.5463153987424e-05, 0.6173092454097e+01, 0.1414349524433e+02,
5840           0.5071611859329e-05, 0.2870244247651e+01, 0.7860419393880e+01,
5841           0.2195112094455e-05, 0.2952338617201e+01, 0.1150676975667e+02,
5842           0.2279139233919e-05, 0.5951775132933e+01, 0.7058598460518e+01,
5843           0.2278386100876e-05, 0.4845456398785e+01, 0.4694002934110e+01,
5844           0.2559088003308e-05, 0.6945321117311e+00, 0.1216800268190e+02,
5845 
5846           0.2561079286856e-05, 0.6167224608301e+01, 0.7099330490126e+00,
5847           0.1792755796387e-05, 0.1400122509632e+01, 0.7962980379786e+00,
5848           0.1818715656502e-05, 0.4703347611830e+01, 0.6283142985870e+01,
5849           0.1818744924791e-05, 0.5086748900237e+01, 0.6283008715021e+01,
5850           0.1554518791390e-05, 0.5331008042713e-01, 0.2513230340178e+02,
5851           0.2063265737239e-05, 0.4283680484178e+01, 0.1179062909082e+02,
5852           0.1497613520041e-05, 0.6074207826073e+01, 0.5486777812467e+01,
5853           0.2000617940427e-05, 0.2501426281450e+01, 0.1778984560711e+02,
5854           0.1289731195580e-05, 0.3646340599536e+01, 0.7079373888424e+01,
5855           0.1282657998934e-05, 0.3232864804902e+01, 0.3738761453707e+01,
5856 
5857           0.1528915968658e-05, 0.5581433416669e+01, 0.2132990797783e+00,
5858           0.1187304098432e-05, 0.5453576453694e+01, 0.9437762937313e+01,
5859           0.7842782928118e-06, 0.2823953922273e+00, 0.8827390247185e+01,
5860           0.7352892280868e-06, 0.1124369580175e+01, 0.1589072916335e+01,
5861           0.6570189360797e-06, 0.2089154042840e+01, 0.1176985366291e+02,
5862           0.6324967590410e-06, 0.6704855581230e+00, 0.6262300422539e+01,
5863           0.6298289872283e-06, 0.2836414855840e+01, 0.6303851278352e+01,
5864           0.6476686465855e-06, 0.4852433866467e+00, 0.7113454667900e-02,
5865           0.8587034651234e-06, 0.1453511005668e+01, 0.1672837615881e+03,
5866           0.8068948788113e-06, 0.9224087798609e+00, 0.6069776770667e+01,
5867 
5868           0.8353786011661e-06, 0.4631707184895e+01, 0.3340612434717e+01,
5869           0.6009324532132e-06, 0.1829498827726e+01, 0.4136910472696e+01,
5870           0.7558158559566e-06, 0.2588596800317e+01, 0.6496374930224e+01,
5871           0.5809279504503e-06, 0.5516818853476e+00, 0.1097707878456e+02,
5872           0.5374131950254e-06, 0.6275674734960e+01, 0.1194447056968e+01,
5873           0.5711160507326e-06, 0.1091905956872e+01, 0.6282095334605e+01,
5874           0.5710183170746e-06, 0.2415001635090e+01, 0.6284056366286e+01,
5875           0.5144373590610e-06, 0.6020336443438e+01, 0.6290189305114e+01,
5876           0.5103108927267e-06, 0.3775634564605e+01, 0.6275962395778e+01,
5877           0.4960654697891e-06, 0.1073450946756e+01, 0.6127655567643e+01,
5878 
5879           0.4786385689280e-06, 0.2431178012310e+01, 0.6438496133249e+01,
5880           0.6109911263665e-06, 0.5343356157914e+01, 0.3154687086868e+01,
5881           0.4839898944024e-06, 0.5830833594047e-01, 0.8018209333619e+00,
5882           0.4734822623919e-06, 0.4536080134821e+01, 0.3128388763578e+01,
5883           0.4834741473290e-06, 0.2585090489754e+00, 0.7084896783808e+01,
5884           0.5134858581156e-06, 0.4213317172603e+01, 0.1235285262111e+02,
5885           0.5064004264978e-06, 0.4814418806478e+00, 0.1185621865188e+02,
5886           0.3753476772761e-06, 0.1599953399788e+01, 0.8429241228195e+01,
5887           0.4935264014283e-06, 0.2157417556873e+01, 0.2544314396739e+01,
5888           0.3950929600897e-06, 0.3359394184254e+01, 0.5481254917084e+01,
5889 
5890           0.4895849789777e-06, 0.5165704376558e+01, 0.9225539266174e+01,
5891           0.4215241688886e-06, 0.2065368800993e+01, 0.1726015463500e+02,
5892           0.3796773731132e-06, 0.1468606346612e+01, 0.4265981595566e+00,
5893           0.3114178142515e-06, 0.3615638079474e+01, 0.2146165377750e+01,
5894           0.3260664220838e-06, 0.4417134922435e+01, 0.4164311961999e+01,
5895           0.3976996123008e-06, 0.4700866883004e+01, 0.5856477690889e+01,
5896           0.2801459672924e-06, 0.4538902060922e+01, 0.1256967486051e+02,
5897           0.3638931868861e-06, 0.1334197991475e+01, 0.1807370494127e+02,
5898           0.2487013269476e-06, 0.3749275558275e+01, 0.2629832328990e-01,
5899           0.3034165481994e-06, 0.4236622030873e+00, 0.4535059491685e+01,
5900 
5901           0.2676278825586e-06, 0.5970848007811e+01, 0.3930209696940e+01,
5902           0.2764903818918e-06, 0.5194636754501e+01, 0.1256262854127e+02,
5903           0.2485149930507e-06, 0.1002434207846e+01, 0.5088628793478e+01,
5904           0.2199305540941e-06, 0.3066773098403e+01, 0.1255903824622e+02,
5905           0.2571106500435e-06, 0.7588312459063e+00, 0.1336797263425e+02,
5906           0.2049751817158e-06, 0.3444977434856e+01, 0.1137170464392e+02,
5907           0.2599707296297e-06, 0.1873128542205e+01, 0.7143069561767e+02,
5908           0.1785018072217e-06, 0.5015891306615e+01, 0.1748016358760e+01,
5909           0.2324833891115e-06, 0.4618271239730e+01, 0.1831953657923e+02,
5910           0.1709711119545e-06, 0.5300003455669e+01, 0.4933208510675e+01,
5911 
5912           0.2107159351716e-06, 0.2229819815115e+01, 0.7477522907414e+01,
5913           0.1750333080295e-06, 0.6161485880008e+01, 0.1044738781244e+02,
5914           0.2000598210339e-06, 0.2967357299999e+01, 0.8031092209206e+01,
5915           0.1380920248681e-06, 0.3027007923917e+01, 0.8635942003952e+01,
5916           0.1412460470299e-06, 0.6037597163798e+01, 0.2942463415728e+01,
5917           0.1888459803001e-06, 0.8561476243374e+00, 0.1561374759853e+03,
5918           0.1788370542585e-06, 0.4869736290209e+01, 0.1592596075957e+01,
5919           0.1360893296167e-06, 0.3626411886436e+01, 0.1309584267300e+02,
5920           0.1506846530160e-06, 0.1550975377427e+01, 0.1649636139783e+02,
5921           0.1800913376176e-06, 0.2075826033190e+01, 0.1729818233119e+02,
5922 
5923           0.1436261390649e-06, 0.6148876420255e+01, 0.2042657109477e+02,
5924           0.1220227114151e-06, 0.4382583879906e+01, 0.7632943190217e+01,
5925           0.1337883603592e-06, 0.2036644327361e+01, 0.1213955354133e+02,
5926           0.1159326650738e-06, 0.3892276994687e+01, 0.5331357529664e+01,
5927           0.1352853128569e-06, 0.1447950649744e+01, 0.1673046366289e+02,
5928           0.1433408296083e-06, 0.4457854692961e+01, 0.7342457794669e+01,
5929           0.1234701666518e-06, 0.1538818147151e+01, 0.6279485555400e+01,
5930           0.1234027192007e-06, 0.1968523220760e+01, 0.6286666145492e+01,
5931           0.1244024091797e-06, 0.5779803499985e+01, 0.1511046609763e+02,
5932           0.1097934945516e-06, 0.6210975221388e+00, 0.1098880815746e+02,
5933 
5934           0.1254611329856e-06, 0.2591963807998e+01, 0.1572083878776e+02,
5935           0.1158247286784e-06, 0.2483612812670e+01, 0.5729506548653e+01,
5936           0.9039078252960e-07, 0.3857554579796e+01, 0.9623688285163e+01,
5937           0.9108024978836e-07, 0.5826368512984e+01, 0.7234794171227e+01,
5938           0.8887068108436e-07, 0.3475694573987e+01, 0.6148010737701e+01,
5939           0.8632374035438e-07, 0.3059070488983e-01, 0.6418140963190e+01,
5940           0.7893186992967e-07, 0.1583194837728e+01, 0.2118763888447e+01,
5941           0.8297650201172e-07, 0.8519770534637e+00, 0.1471231707864e+02,
5942           0.1019759578988e-06, 0.1319598738732e+00, 0.1349867339771e+01,
5943           0.1010037696236e-06, 0.9937860115618e+00, 0.6836645152238e+01,
5944 
5945           0.1047727548266e-06, 0.1382138405399e+01, 0.5999216516294e+01,
5946           0.7351993881086e-07, 0.3833397851735e+01, 0.6040347114260e+01,
5947           0.9868771092341e-07, 0.2124913814390e+01, 0.6566935184597e+01,
5948           0.7007321959390e-07, 0.5946305343763e+01, 0.6525804586632e+01,
5949           0.6861411679709e-07, 0.4574654977089e+01, 0.7238675589263e+01,
5950           0.7554519809614e-07, 0.5949232686844e+01, 0.1253985337760e+02,
5951           0.9541880448335e-07, 0.3495242990564e+01, 0.2122839202813e+02,
5952           0.7185606722155e-07, 0.4310113471661e+01, 0.6245048154254e+01,
5953           0.7131360871710e-07, 0.5480309323650e+01, 0.6321103546637e+01,
5954           0.6651142021039e-07, 0.5411097713654e+01, 0.5327476111629e+01,
5955 
5956           0.8538618213667e-07, 0.1827849973951e+01, 0.1101510648075e+02,
5957           0.8634954288044e-07, 0.5443584943349e+01, 0.5643178611111e+01,
5958           0.7449415051484e-07, 0.2011535459060e+01, 0.5368044267797e+00,
5959           0.7421047599169e-07, 0.3464562529249e+01, 0.2354323048545e+02,
5960           0.6140694354424e-07, 0.5657556228815e+01, 0.1296430071988e+02,
5961           0.6353525143033e-07, 0.3463816593821e+01, 0.1990745094947e+01,
5962           0.6221964013447e-07, 0.1532259498697e+01, 0.9517183207817e+00,
5963           0.5852480257244e-07, 0.1375396598875e+01, 0.9555997388169e+00,
5964           0.6398637498911e-07, 0.2405645801972e+01, 0.2407292145756e+02,
5965           0.7039744069878e-07, 0.5397541799027e+01, 0.5225775174439e+00,
5966 
5967           0.6977997694382e-07, 0.4762347105419e+01, 0.1097355562493e+02,
5968           0.7460629558396e-07, 0.2711944692164e+01, 0.2200391463820e+02,
5969           0.5376577536101e-07, 0.2352980430239e+01, 0.1431416805965e+02,
5970           0.7530607893556e-07, 0.1943940180699e+01, 0.1842262939178e+02,
5971           0.6822928971605e-07, 0.4337651846959e+01, 0.1554202828031e+00,
5972           0.6220772380094e-07, 0.6716871369278e+00, 0.1845107853235e+02,
5973           0.6586950799043e-07, 0.2229714460505e+01, 0.5216580451554e+01,
5974           0.5873800565771e-07, 0.7627013920580e+00, 0.6398972393349e+00,
5975           0.6264346929745e-07, 0.6202785478961e+00, 0.6277552955062e+01,
5976           0.6257929115669e-07, 0.2886775596668e+01, 0.6288598745829e+01,
5977 
5978           0.5343536033409e-07, 0.1977241012051e+01, 0.4690479774488e+01,
5979           0.5587849781714e-07, 0.1922923484825e+01, 0.1551045220144e+01,
5980           0.6905100845603e-07, 0.3570757164631e+01, 0.1030928125552e+00,
5981           0.6178957066649e-07, 0.5197558947765e+01, 0.5230807360890e+01,
5982           0.6187270224331e-07, 0.8193497368922e+00, 0.5650292065779e+01,
5983           0.5385664291426e-07, 0.5406336665586e+01, 0.7771377146812e+02,
5984           0.6329363917926e-07, 0.2837760654536e+01, 0.2608790314060e+02,
5985           0.4546018761604e-07, 0.2933580297050e+01, 0.5535693017924e+00,
5986           0.6196091049375e-07, 0.4157871494377e+01, 0.8467247584405e+02,
5987           0.6159555108218e-07, 0.3211703561703e+01, 0.2394243902548e+03,
5988 
5989           0.4995340539317e-07, 0.1459098102922e+01, 0.4732030630302e+01,
5990           0.5457031243572e-07, 0.1430457676136e+01, 0.6179983037890e+01,
5991           0.4863461418397e-07, 0.2196425916730e+01, 0.9027992316901e+02,
5992           0.5342947626870e-07, 0.2086612890268e+01, 0.6386168663001e+01,
5993           0.5674296648439e-07, 0.2760204966535e+01, 0.6915859635113e+01,
5994           0.4745783120161e-07, 0.4245368971862e+01, 0.6282970628506e+01,
5995           0.4745676961198e-07, 0.5544725787016e+01, 0.6283181072386e+01,
5996           0.4049796869973e-07, 0.2213984363586e+01, 0.6254626709878e+01,
5997           0.4248333596940e-07, 0.8075781952896e+00, 0.7875671926403e+01,
5998           0.4027178070205e-07, 0.1293268540378e+01, 0.6311524991013e+01,
5999 
6000           0.4066543943476e-07, 0.3986141175804e+01, 0.3634620989887e+01,
6001           0.4858863787880e-07, 0.1276112738231e+01, 0.5760498333002e+01,
6002           0.5277398263530e-07, 0.4916111741527e+01, 0.2515860172507e+02,
6003           0.4105635656559e-07, 0.1725805864426e+01, 0.6709674010002e+01,
6004           0.4376781925772e-07, 0.2243642442106e+01, 0.6805653367890e+01,
6005           0.3235827894693e-07, 0.3614135118271e+01, 0.1066495398892e+01,
6006           0.3073244740308e-07, 0.2460873393460e+01, 0.5863591145557e+01,
6007           0.3088609271373e-07, 0.5678431771790e+01, 0.9917696840332e+01,
6008           0.3393022279836e-07, 0.3814017477291e+01, 0.1391601904066e+02,
6009           0.3038686508802e-07, 0.4660216229171e+01, 0.1256621883632e+02,
6010 
6011           0.4019677752497e-07, 0.5906906243735e+01, 0.1334167431096e+02,
6012           0.3288834998232e-07, 0.9536146445882e+00, 0.1620077269078e+02,
6013           0.3889973794631e-07, 0.3942205097644e+01, 0.7478166569050e-01,
6014           0.3050438987141e-07, 0.1624810271286e+01, 0.1805292951336e+02,
6015           0.3601142564638e-07, 0.4030467142575e+01, 0.6208294184755e+01,
6016           0.3689015557141e-07, 0.3648878818694e+01, 0.5966683958112e+01,
6017           0.3563471893565e-07, 0.5749584017096e+01, 0.6357857516136e+01,
6018           0.2776183170667e-07, 0.2630124187070e+01, 0.3523159621801e-02,
6019           0.2922350530341e-07, 0.1790346403629e+01, 0.1272157198369e+02,
6020           0.3511076917302e-07, 0.6142198301611e+01, 0.6599467742779e+01,
6021 
6022           0.3619351007632e-07, 0.1432421386492e+01, 0.6019991944201e+01,
6023           0.2561254711098e-07, 0.2302822475792e+01, 0.1259245002418e+02,
6024           0.2626903942920e-07, 0.8660470994571e+00, 0.6702560555334e+01,
6025           0.2550187397083e-07, 0.6069721995383e+01, 0.1057540660594e+02,
6026           0.2535873526138e-07, 0.1079020331795e-01, 0.3141537925223e+02,
6027           0.3519786153847e-07, 0.3809066902283e+01, 0.2505706758577e+03,
6028           0.3424651492873e-07, 0.2075435114417e+01, 0.6546159756691e+01,
6029           0.2372676630861e-07, 0.2057803120154e+01, 0.2388894113936e+01,
6030           0.2710980779541e-07, 0.1510068488010e+01, 0.1202934727411e+02,
6031           0.3038710889704e-07, 0.5043617528901e+01, 0.1256608456547e+02,
6032 
6033           0.2220364130585e-07, 0.3694793218205e+01, 0.1336244973887e+02,
6034           0.3025880825460e-07, 0.5450618999049e-01, 0.2908881142201e+02,
6035           0.2784493486864e-07, 0.3381164084502e+01, 0.1494531617769e+02,
6036           0.2294414142438e-07, 0.4382309025210e+01, 0.6076890225335e+01,
6037           0.2012723294724e-07, 0.9142212256518e+00, 0.6262720680387e+01,
6038           0.2036357831958e-07, 0.5676172293154e+01, 0.4701116388778e+01,
6039           0.2003474823288e-07, 0.2592767977625e+01, 0.6303431020504e+01,
6040           0.2207144900109e-07, 0.5404976271180e+01, 0.6489261475556e+01,
6041           0.2481664905135e-07, 0.4373284587027e+01, 0.1204357418345e+02,
6042           0.2674949182295e-07, 0.5859182188482e+01, 0.4590910121555e+01,
6043 
6044           0.2450554720322e-07, 0.4555381557451e+01, 0.1495633313810e+00,
6045           0.2601975986457e-07, 0.3933165584959e+01, 0.1965104848470e+02,
6046           0.2199860022848e-07, 0.5227977189087e+01, 0.1351787002167e+02,
6047           0.2448121172316e-07, 0.4858060353949e+01, 0.1162474756779e+01,
6048           0.1876014864049e-07, 0.5690546553605e+01, 0.6279194432410e+01,
6049           0.1874513219396e-07, 0.4099539297446e+01, 0.6286957268481e+01,
6050           0.2156380842559e-07, 0.4382594769913e+00, 0.1813929450232e+02,
6051           0.1981691240061e-07, 0.1829784152444e+01, 0.4686889479442e+01,
6052           0.2329992648539e-07, 0.2836254278973e+01, 0.1002183730415e+02,
6053           0.1765184135302e-07, 0.2803494925833e+01, 0.4292330755499e+01,
6054 
6055           0.2436368366085e-07, 0.2836897959677e+01, 0.9514313292143e+02,
6056           0.2164089203889e-07, 0.6127522446024e+01, 0.6037244212485e+01,
6057           0.1847755034221e-07, 0.3683163635008e+01, 0.2427287361862e+00,
6058           0.1674798769966e-07, 0.3316993867246e+00, 0.1311972100268e+02,
6059           0.2222542124356e-07, 0.8294097805480e+00, 0.1266924451345e+02,
6060           0.2071074505925e-07, 0.3659492220261e+01, 0.6528907488406e+01,
6061           0.1608224471835e-07, 0.4774492067182e+01, 0.1352175143971e+02,
6062           0.1857583439071e-07, 0.2873120597682e+01, 0.8662240327241e+01,
6063           0.1793018836159e-07, 0.5282441177929e+00, 0.6819880277225e+01,
6064           0.1575391221692e-07, 0.1320789654258e+01, 0.1102062672231e+00,
6065 
6066           0.1840132009557e-07, 0.1917110916256e+01, 0.6514761976723e+02,
6067           0.1760917288281e-07, 0.2972635937132e+01, 0.5746271423666e+01,
6068           0.1561779518516e-07, 0.4372569261981e+01, 0.6272439236156e+01,
6069           0.1558687885205e-07, 0.5416424926425e+01, 0.6293712464735e+01,
6070           0.1951359382579e-07, 0.3094448898752e+01, 0.2301353951334e+02,
6071           0.1569144275614e-07, 0.2802103689808e+01, 0.1765478049437e+02,
6072           0.1479130389462e-07, 0.2136435020467e+01, 0.2077542790660e-01,
6073           0.1467828510764e-07, 0.7072627435674e+00, 0.1052268489556e+01,
6074           0.1627627337440e-07, 0.3947607143237e+01, 0.6327837846670e+00,
6075           0.1503498479758e-07, 0.4079248909190e+01, 0.7626583626240e-01,
6076 
6077           0.1297967708237e-07, 0.6269637122840e+01, 0.1149965630200e+02,
6078           0.1374416896634e-07, 0.4175657970702e+01, 0.6016468784579e+01,
6079           0.1783812325219e-07, 0.1476540547560e+01, 0.3301902111895e+02,
6080           0.1525884228756e-07, 0.4653477715241e+01, 0.9411464614024e+01,
6081           0.1451067396763e-07, 0.2573001128225e+01, 0.1277945078067e+02,
6082           0.1297713111950e-07, 0.5612799618771e+01, 0.6549682916313e+01,
6083           0.1462784012820e-07, 0.4189661623870e+01, 0.1863592847156e+02,
6084           0.1384185980007e-07, 0.2656915472196e+01, 0.2379164476796e+01,
6085           0.1221497599801e-07, 0.5612515760138e+01, 0.1257326515556e+02,
6086           0.1560574525896e-07, 0.4783414317919e+01, 0.1887552587463e+02,
6087 
6088           0.1544598372036e-07, 0.2694431138063e+01, 0.1820933031200e+02,
6089           0.1531678928696e-07, 0.4105103489666e+01, 0.2593412433514e+02,
6090           0.1349321503795e-07, 0.3082437194015e+00, 0.5120601093667e+01,
6091           0.1252030290917e-07, 0.6124072334087e+01, 0.6993008899458e+01,
6092           0.1459243816687e-07, 0.3733103981697e+01, 0.3813291813120e-01,
6093           0.1226103625262e-07, 0.1267127706817e+01, 0.2435678079171e+02,
6094           0.1019449641504e-07, 0.4367790112269e+01, 0.1725663147538e+02,
6095           0.1380789433607e-07, 0.3387201768700e+01, 0.2458316379602e+00,
6096           0.1019453421658e-07, 0.9204143073737e+00, 0.6112403035119e+01,
6097           0.1297929434405e-07, 0.5786874896426e+01, 0.1249137003520e+02,
6098 
6099           0.9912677786097e-08, 0.3164232870746e+01, 0.6247047890016e+01,
6100           0.9829386098599e-08, 0.2586762413351e+01, 0.6453748665772e+01,
6101           0.1226807746104e-07, 0.6239068436607e+01, 0.5429879531333e+01,
6102           0.1192691755997e-07, 0.1867380051424e+01, 0.6290122169689e+01,
6103           0.9836499227081e-08, 0.3424716293727e+00, 0.6319103810876e+01,
6104           0.9642862564285e-08, 0.5661372990657e+01, 0.8273820945392e+01,
6105           0.1165184404862e-07, 0.5768367239093e+01, 0.1778273215245e+02,
6106           0.1175794418818e-07, 0.1657351222943e+01, 0.6276029531202e+01,
6107           0.1018948635601e-07, 0.6458292350865e+00, 0.1254537627298e+02,
6108           0.9500383606676e-08, 0.1054306140741e+01, 0.1256517118505e+02,
6109 
6110           0.1227512202906e-07, 0.2505278379114e+01, 0.2248384854122e+02,
6111           0.9664792009993e-08, 0.4289737277000e+01, 0.6259197520765e+01,
6112           0.9613285666331e-08, 0.5500597673141e+01, 0.6306954180126e+01,
6113           0.1117906736211e-07, 0.2361405953468e+01, 0.1779695906178e+02,
6114           0.9611378640782e-08, 0.2851310576269e+01, 0.2061856251104e+00,
6115           0.8845354852370e-08, 0.6208777705343e+01, 0.1692165728891e+01,
6116           0.1054046966600e-07, 0.5413091423934e+01, 0.2204125344462e+00,
6117           0.1215539124483e-07, 0.5613969479755e+01, 0.8257698122054e+02,
6118           0.9932460955209e-08, 0.1106124877015e+01, 0.1017725758696e+02,
6119           0.8785804715043e-08, 0.2869224476477e+01, 0.9491756770005e+00,
6120 
6121           0.8538084097562e-08, 0.6159640899344e+01, 0.6393282117669e+01,
6122           0.8648994369529e-08, 0.1374901198784e+01, 0.4804209201333e+01,
6123           0.1039063219067e-07, 0.5171080641327e+01, 0.1550861511662e+02,
6124           0.8867983926439e-08, 0.8317320304902e+00, 0.3903911373650e+01,
6125           0.8327495955244e-08, 0.3605591969180e+01, 0.6172869583223e+01,
6126           0.9243088356133e-08, 0.6114299196843e+01, 0.6267823317922e+01,
6127           0.9205657357835e-08, 0.3675153683737e+01, 0.6298328382969e+01,
6128           0.1033269714606e-07, 0.3313328813024e+01, 0.5573142801433e+01,
6129           0.8001706275552e-08, 0.2019980960053e+01, 0.2648454860559e+01,
6130           0.9171858254191e-08, 0.8992015524177e+00, 0.1498544001348e+03,
6131 
6132           0.1075327150242e-07, 0.2898669963648e+01, 0.3694923081589e+02,
6133           0.9884866689828e-08, 0.4946715904478e+01, 0.1140367694411e+02,
6134           0.9541835576677e-08, 0.2371787888469e+01, 0.1256713221673e+02,
6135           0.7739903376237e-08, 0.2213775190612e+01, 0.7834121070590e+01,
6136           0.7311962684106e-08, 0.3429378787739e+01, 0.1192625446156e+02,
6137           0.9724904869624e-08, 0.6195878564404e+01, 0.2280573557157e+02,
6138           0.9251628983612e-08, 0.6511509527390e+00, 0.2787043132925e+01,
6139           0.7320763787842e-08, 0.6001083639421e+01, 0.6282655592598e+01,
6140           0.7320296650962e-08, 0.3789073265087e+01, 0.6283496108294e+01,
6141           0.7947032271039e-08, 0.1059659582204e+01, 0.1241073141809e+02,
6142 
6143           0.9005277053115e-08, 0.1280315624361e+01, 0.6281591679874e+01,
6144           0.8995601652048e-08, 0.2224439106766e+01, 0.6284560021018e+01,
6145           0.8288040568796e-08, 0.5234914433867e+01, 0.1241658836951e+02,
6146           0.6359381347255e-08, 0.4137989441490e+01, 0.1596186371003e+01,
6147           0.8699572228626e-08, 0.1758411009497e+01, 0.6133512519065e+01,
6148           0.6456797542736e-08, 0.5919285089994e+01, 0.1685848245639e+02,
6149           0.7424573475452e-08, 0.5414616938827e+01, 0.4061219149443e+01,
6150           0.7235671196168e-08, 0.1496516557134e+01, 0.1610006857377e+03,
6151           0.8104015182733e-08, 0.1919918242764e+01, 0.8460828644453e+00,
6152           0.8098576535937e-08, 0.3819615855458e+01, 0.3894181736510e+01,
6153 
6154           0.6275292346625e-08, 0.6244264115141e+01, 0.8531963191132e+00,
6155           0.6052432989112e-08, 0.5037731872610e+00, 0.1567108171867e+02,
6156           0.5705651535817e-08, 0.2984557271995e+01, 0.1258692712880e+02,
6157           0.5789650115138e-08, 0.6087038140697e+01, 0.1193336791622e+02,
6158           0.5512132153377e-08, 0.5855668994076e+01, 0.1232342296471e+02,
6159           0.7388890819102e-08, 0.2443128574740e+01, 0.4907302013889e+01,
6160           0.5467593991798e-08, 0.3017561234194e+01, 0.1884211409667e+02,
6161           0.6388519802999e-08, 0.5887386712935e+01, 0.5217580628120e+02,
6162           0.6106777149944e-08, 0.3483461059895e+00, 0.1422690933580e-01,
6163           0.7383420275489e-08, 0.5417387056707e+01, 0.2358125818164e+02,
6164 
6165           0.5505208141738e-08, 0.2848193644783e+01, 0.1151388321134e+02,
6166           0.6310757462877e-08, 0.2349882520828e+01, 0.1041998632314e+02,
6167           0.6166904929691e-08, 0.5728575944077e+00, 0.6151533897323e+01,
6168           0.5263442042754e-08, 0.4495796125937e+01, 0.1885275071096e+02,
6169           0.5591828082629e-08, 0.1355441967677e+01, 0.4337116142245e+00,
6170           0.5397051680497e-08, 0.1673422864307e+01, 0.6286362197481e+01,
6171           0.5396992745159e-08, 0.1833502206373e+01, 0.6279789503410e+01,
6172           0.6572913000726e-08, 0.3331122065824e+01, 0.1176433076753e+02,
6173           0.5123421866413e-08, 0.2165327142679e+01, 0.1245594543367e+02,
6174           0.5930495725999e-08, 0.2931146089284e+01, 0.6414617803568e+01,
6175 
6176           0.6431797403933e-08, 0.4134407994088e+01, 0.1350651127443e+00,
6177           0.5003182207604e-08, 0.3805420303749e+01, 0.1096996532989e+02,
6178           0.5587731032504e-08, 0.1082469260599e+01, 0.6062663316000e+01,
6179           0.5935263407816e-08, 0.8384333678401e+00, 0.5326786718777e+01,
6180           0.4756019827760e-08, 0.3552588749309e+01, 0.3104930017775e+01,
6181           0.6599951172637e-08, 0.4320826409528e+01, 0.4087944051283e+02,
6182           0.5902606868464e-08, 0.4811879454445e+01, 0.5849364236221e+01,
6183           0.5921147809031e-08, 0.9942628922396e-01, 0.1581959461667e+01,
6184           0.5505382581266e-08, 0.2466557607764e+01, 0.6503488384892e+01,
6185           0.5353771071862e-08, 0.4551978748683e+01, 0.1735668374386e+03,
6186 
6187           0.5063282210946e-08, 0.5710812312425e+01, 0.1248988586463e+02,
6188           0.5926120403383e-08, 0.1333998428358e+01, 0.2673594526851e+02,
6189           0.5211016176149e-08, 0.4649315360760e+01, 0.2460261242967e+02,
6190           0.5347075084894e-08, 0.5512754081205e+01, 0.4171425416666e+01,
6191           0.4872609773574e-08, 0.1308025299938e+01, 0.5333900173445e+01,
6192           0.4727711321420e-08, 0.2144908368062e+01, 0.7232251527446e+01,
6193           0.6029426018652e-08, 0.5567259412084e+01, 0.3227113045244e+03,
6194           0.4321485284369e-08, 0.5230667156451e+01, 0.9388005868221e+01,
6195           0.4476406760553e-08, 0.6134081115303e+01, 0.5547199253223e+01,
6196           0.5835268277420e-08, 0.4783808492071e+01, 0.7285056171570e+02,
6197 
6198           0.5172183602748e-08, 0.5161817911099e+01, 0.1884570439172e+02,
6199           0.5693571465184e-08, 0.1381646203111e+01, 0.9723862754494e+02,
6200           0.4060634965349e-08, 0.3876705259495e+00, 0.4274518229222e+01,
6201           0.3967398770473e-08, 0.5029491776223e+01, 0.3496032717521e+01,
6202           0.3943754005255e-08, 0.1923162955490e+01, 0.6244942932314e+01,
6203           0.4781323427824e-08, 0.4633332586423e+01, 0.2929661536378e+02,
6204           0.3871483781204e-08, 0.1616650009743e+01, 0.6321208768577e+01,
6205           0.5141741733997e-08, 0.9817316704659e-01, 0.1232032006293e+02,
6206           0.4002385978497e-08, 0.3656161212139e+01, 0.7018952447668e+01,
6207           0.4901092604097e-08, 0.4404098713092e+01, 0.1478866649112e+01,
6208 
6209           0.3740932630345e-08, 0.5181188732639e+00, 0.6922973089781e+01,
6210           0.4387283718538e-08, 0.3254859566869e+01, 0.2331413144044e+03,
6211           0.5019197802033e-08, 0.3086773224677e+01, 0.1715706182245e+02,
6212           0.3834931695175e-08, 0.2797882673542e+01, 0.1491901785440e+02,
6213           0.3760413942497e-08, 0.2892676280217e+01, 0.1726726808967e+02,
6214           0.3719717204628e-08, 0.5861046025739e+01, 0.6297302759782e+01,
6215           0.4145623530149e-08, 0.2168239627033e+01, 0.1376059875786e+02,
6216           0.3932788425380e-08, 0.6271811124181e+01, 0.7872148766781e+01,
6217           0.3686377476857e-08, 0.3936853151404e+01, 0.6268848941110e+01,
6218           0.3779077950339e-08, 0.1404148734043e+01, 0.4157198507331e+01,
6219 
6220           0.4091334550598e-08, 0.2452436180854e+01, 0.9779108567966e+01,
6221           0.3926694536146e-08, 0.6102292739040e+01, 0.1098419223922e+02,
6222           0.4841000253289e-08, 0.6072760457276e+01, 0.1252801878276e+02,
6223           0.4949340130240e-08, 0.1154832815171e+01, 0.1617106187867e+03,
6224           0.3761557737360e-08, 0.5527545321897e+01, 0.3185192151914e+01,
6225           0.3647396268188e-08, 0.1525035688629e+01, 0.6271346477544e+01,
6226           0.3932405074189e-08, 0.5570681040569e+01, 0.2139354194808e+02,
6227           0.3631322501141e-08, 0.1981240601160e+01, 0.6294805223347e+01,
6228           0.4130007425139e-08, 0.2050060880201e+01, 0.2195415756911e+02,
6229           0.4433905965176e-08, 0.3277477970321e+01, 0.7445550607224e+01,
6230 
6231           0.3851814176947e-08, 0.5210690074886e+01, 0.9562891316684e+00,
6232           0.3485807052785e-08, 0.6653274904611e+00, 0.1161697602389e+02,
6233           0.3979772816991e-08, 0.1767941436148e+01, 0.2277943724828e+02,
6234           0.3402607460500e-08, 0.3421746306465e+01, 0.1087398597200e+02,
6235           0.4049993000926e-08, 0.1127144787547e+01, 0.3163918923335e+00,
6236           0.3420511182382e-08, 0.4214794779161e+01, 0.1362553364512e+02,
6237           0.3640772365012e-08, 0.5324905497687e+01, 0.1725304118033e+02,
6238           0.3323037987501e-08, 0.6135761838271e+01, 0.6279143387820e+01,
6239           0.4503141663637e-08, 0.1802305450666e+01, 0.1385561574497e+01,
6240           0.4314560055588e-08, 0.4812299731574e+01, 0.4176041334900e+01,
6241 
6242           0.3294226949110e-08, 0.3657547059723e+01, 0.6287008313071e+01,
6243           0.3215657197281e-08, 0.4866676894425e+01, 0.5749861718712e+01,
6244           0.4129362656266e-08, 0.3809342558906e+01, 0.5905702259363e+01,
6245           0.3137762976388e-08, 0.2494635174443e+01, 0.2099539292909e+02,
6246           0.3514010952384e-08, 0.2699961831678e+01, 0.7335344340001e+01,
6247           0.3327607571530e-08, 0.3318457714816e+01, 0.5436992986000e+01,
6248           0.3541066946675e-08, 0.4382703582466e+01, 0.1234573916645e+02,
6249           0.3216179847052e-08, 0.5271066317054e+01, 0.3802769619140e-01,
6250           0.2959045059570e-08, 0.5819591585302e+01, 0.2670964694522e+02,
6251           0.3884040326665e-08, 0.5980934960428e+01, 0.6660449441528e+01,
6252 
6253           0.2922027539886e-08, 0.3337290282483e+01, 0.1375773836557e+01,
6254           0.4110846382042e-08, 0.5742978187327e+01, 0.4480965020977e+02,
6255           0.2934508411032e-08, 0.2278075804200e+01, 0.6408777551755e+00,
6256           0.3966896193000e-08, 0.5835747858477e+01, 0.3773735910827e+00,
6257           0.3286695827610e-08, 0.5838898193902e+01, 0.3932462625300e-02,
6258           0.3720643094196e-08, 0.1122212337858e+01, 0.1646033343740e+02,
6259           0.3285508906174e-08, 0.9182250996416e+00, 0.1081813534213e+02,
6260           0.3753880575973e-08, 0.5174761973266e+01, 0.5642198095270e+01,
6261           0.3022129385587e-08, 0.3381611020639e+01, 0.2982630633589e+02,
6262           0.2798569205621e-08, 0.3546193723922e+01, 0.1937891852345e+02,
6263 
6264           0.3397872070505e-08, 0.4533203197934e+01, 0.6923953605621e+01,
6265           0.3708099772977e-08, 0.2756168198616e+01, 0.3066615496545e+02,
6266           0.3599283541510e-08, 0.1934395469918e+01, 0.6147450479709e+01,
6267           0.3688702753059e-08, 0.7149920971109e+00, 0.2636725487657e+01,
6268           0.2681084724003e-08, 0.4899819493154e+01, 0.6816289982179e+01,
6269           0.3495993460759e-08, 0.1572418915115e+01, 0.6418701221183e+01,
6270           0.3130770324995e-08, 0.8912190180489e+00, 0.1235996607578e+02,
6271           0.2744353821941e-08, 0.3800821940055e+01, 0.2059724391010e+02,
6272           0.2842732906341e-08, 0.2644717440029e+01, 0.2828699048865e+02,
6273           0.3046882682154e-08, 0.3987793020179e+01, 0.6055599646783e+01,
6274 
6275           0.2399072455143e-08, 0.9908826440764e+00, 0.6255674361143e+01,
6276           0.2384306274204e-08, 0.2516149752220e+01, 0.6310477339748e+01,
6277           0.2977324500559e-08, 0.5849195642118e+01, 0.1652265972112e+02,
6278           0.3062835258972e-08, 0.1681660100162e+01, 0.1172006883645e+02,
6279           0.3109682589231e-08, 0.5804143987737e+00, 0.2751146787858e+02,
6280           0.2903920355299e-08, 0.5800768280123e+01, 0.6510552054109e+01,
6281           0.2823221989212e-08, 0.9241118370216e+00, 0.5469525544182e+01,
6282           0.3187949696649e-08, 0.3139776445735e+01, 0.1693792562116e+03,
6283           0.2922559771655e-08, 0.3549440782984e+01, 0.2630839062450e+00,
6284           0.2436302066603e-08, 0.4735540696319e+01, 0.3946258593675e+00,
6285 
6286           0.3049473043606e-08, 0.4998289124561e+01, 0.8390110365991e+01,
6287           0.2863682575784e-08, 0.6709515671102e+00, 0.2243449970715e+00,
6288           0.2641750517966e-08, 0.5410978257284e+01, 0.2986433403208e+02,
6289           0.2704093466243e-08, 0.4778317207821e+01, 0.6129297044991e+01,
6290           0.2445522177011e-08, 0.6009020662222e+01, 0.1171295538178e+02,
6291           0.2623608810230e-08, 0.5010449777147e+01, 0.6436854655901e+01,
6292           0.2079259704053e-08, 0.5980943768809e+01, 0.2019909489111e+02,
6293           0.2820225596771e-08, 0.2679965110468e+01, 0.5934151399930e+01,
6294           0.2365221950927e-08, 0.1894231148810e+01, 0.2470570524223e+02,
6295           0.2359682077149e-08, 0.4220752950780e+01, 0.8671969964381e+01,
6296 
6297           0.2387577137206e-08, 0.2571783940617e+01, 0.7096626156709e+01,
6298           0.1982102089816e-08, 0.5169765997119e+00, 0.1727188400790e+02,
6299           0.2687502389925e-08, 0.6239078264579e+01, 0.7075506709219e+02,
6300           0.2207751669135e-08, 0.2031184412677e+01, 0.4377611041777e+01,
6301           0.2618370214274e-08, 0.8266079985979e+00, 0.6632000300961e+01,
6302           0.2591951887361e-08, 0.8819350522008e+00, 0.4873985990671e+02,
6303           0.2375055656248e-08, 0.3520944177789e+01, 0.1590676413561e+02,
6304           0.2472019978911e-08, 0.1551431908671e+01, 0.6612329252343e+00,
6305           0.2368157127199e-08, 0.4178610147412e+01, 0.3459636466239e+02,
6306           0.1764846605693e-08, 0.1506764000157e+01, 0.1980094587212e+02,
6307 
6308           0.2291769608798e-08, 0.2118250611782e+01, 0.2844914056730e-01,
6309           0.2209997316943e-08, 0.3363255261678e+01, 0.2666070658668e+00,
6310           0.2292699097923e-08, 0.4200423956460e+00, 0.1484170571900e-02,
6311           0.1629683015329e-08, 0.2331362582487e+01, 0.3035599730800e+02,
6312           0.2206492862426e-08, 0.3400274026992e+01, 0.6281667977667e+01,
6313           0.2205746568257e-08, 0.1066051230724e+00, 0.6284483723224e+01,
6314           0.2026310767991e-08, 0.2779066487979e+01, 0.2449240616245e+02,
6315           0.1762977622163e-08, 0.9951450691840e+00, 0.2045286941806e+02,
6316           0.1368535049606e-08, 0.6402447365817e+00, 0.2473415438279e+02,
6317           0.1720598775450e-08, 0.2303524214705e+00, 0.1679593901136e+03,
6318 
6319           0.1702429015449e-08, 0.6164622655048e+01, 0.3338575901272e+03,
6320           0.1414033197685e-08, 0.3954561185580e+01, 0.1624205518357e+03,
6321           0.1573768958043e-08, 0.2028286308984e+01, 0.3144167757552e+02,
6322           0.1650705184447e-08, 0.2304040666128e+01, 0.5267006960365e+02,
6323           0.1651087618855e-08, 0.2538461057280e+01, 0.8956999012000e+02,
6324           0.1616409518983e-08, 0.5111054348152e+01, 0.3332657872986e+02,
6325           0.1537175173581e-08, 0.5601130666603e+01, 0.3852657435933e+02,
6326           0.1593191980553e-08, 0.2614340453411e+01, 0.2282781046519e+03,
6327           0.1499480170643e-08, 0.3624721577264e+01, 0.2823723341956e+02,
6328           0.1493807843235e-08, 0.4214569879008e+01, 0.2876692439167e+02,
6329 
6330           0.1074571199328e-08, 0.1496911744704e+00, 0.8397383534231e+02,
6331           0.1074406983417e-08, 0.1187817671922e+01, 0.8401985929482e+02,
6332           0.9757576855851e-09, 0.2655703035858e+01, 0.7826370942180e+02,
6333           0.1258432887565e-08, 0.4969896184844e+01, 0.3115650189215e+03,
6334           0.1240336343282e-08, 0.5192460776926e+01, 0.1784300471910e+03,
6335           0.9016107005164e-09, 0.1960356923057e+01, 0.5886454391678e+02,
6336           0.1135392360918e-08, 0.5082427809068e+01, 0.7842370451713e+02,
6337           0.9216046089565e-09, 0.2793775037273e+01, 0.1014262087719e+03,
6338           0.1061276615030e-08, 0.3726144311409e+01, 0.5660027930059e+02,
6339           0.1010110596263e-08, 0.7404080708937e+00, 0.4245678405627e+02,
6340 
6341           0.7217424756199e-09, 0.2697449980577e-01, 0.2457074661053e+03,
6342           0.6912003846756e-09, 0.4253296276335e+01, 0.1679936946371e+03,
6343           0.6871814664847e-09, 0.5148072412354e+01, 0.6053048899753e+02,
6344           0.4887158016343e-09, 0.2153581148294e+01, 0.9656299901946e+02,
6345           0.5161802866314e-09, 0.3852750634351e+01, 0.2442876000072e+03,
6346           0.5652599559057e-09, 0.1233233356270e+01, 0.8365903305582e+02,
6347           0.4710812608586e-09, 0.5610486976767e+01, 0.3164282286739e+03,
6348           0.4909977500324e-09, 0.1639629524123e+01, 0.4059982187939e+03,
6349           0.4772641839378e-09, 0.3737100368583e+01, 0.1805255418145e+03,
6350           0.4487562567153e-09, 0.1158417054478e+00, 0.8433466158131e+02,
6351 
6352           0.3943441230497e-09, 0.6243502862796e+00, 0.2568537517081e+03,
6353           0.3952236913598e-09, 0.3510377382385e+01, 0.2449975330562e+03,
6354           0.3788898363417e-09, 0.5916128302299e+01, 0.1568131045107e+03,
6355           0.3738329328831e-09, 0.1042266763456e+01, 0.3948519331910e+03,
6356           0.2451199165151e-09, 0.1166788435700e+01, 0.1435713242844e+03,
6357           0.2436734402904e-09, 0.3254726114901e+01, 0.2268582385539e+03,
6358           0.2213605274325e-09, 0.1687210598530e+01, 0.1658638954901e+03,
6359           0.1491521204829e-09, 0.2657541786794e+01, 0.2219950288015e+03,
6360           0.1474995329744e-09, 0.5013089805819e+01, 0.3052819430710e+03,
6361           0.1661939475656e-09, 0.5495315428418e+01, 0.2526661704812e+03,
6362 
6363           0.9015946748003e-10, 0.2236989966505e+01, 0.4171445043968e+03 };
6364 
6365     /* Sun-to-Earth, T^0, Z */
6366       static final double e0z[] = {
6367           0.2796207639075e-05, 0.3198701560209e+01, 0.8433466158131e+02,
6368           0.1016042198142e-05, 0.5422360395913e+01, 0.5507553240374e+01,
6369           0.8044305033647e-06, 0.3880222866652e+01, 0.5223693906222e+01,
6370           0.4385347909274e-06, 0.3704369937468e+01, 0.2352866153506e+01,
6371           0.3186156414906e-06, 0.3999639363235e+01, 0.1577343543434e+01,
6372           0.2272412285792e-06, 0.3984738315952e+01, 0.1047747311755e+01,
6373           0.1645620103007e-06, 0.3565412516841e+01, 0.5856477690889e+01,
6374           0.1815836921166e-06, 0.4984507059020e+01, 0.6283075850446e+01,
6375           0.1447461676364e-06, 0.3702753570108e+01, 0.9437762937313e+01,
6376           0.1430760876382e-06, 0.3409658712357e+01, 0.1021328554739e+02,
6377 
6378           0.1120445753226e-06, 0.4829561570246e+01, 0.1414349524433e+02,
6379           0.1090232840797e-06, 0.2080729178066e+01, 0.6812766822558e+01,
6380           0.9715727346551e-07, 0.3476295881948e+01, 0.4694002934110e+01,
6381           0.1036267136217e-06, 0.4056639536648e+01, 0.7109288135493e+02,
6382           0.8752665271340e-07, 0.4448159519911e+01, 0.5753384878334e+01,
6383           0.8331864956004e-07, 0.4991704044208e+01, 0.7084896783808e+01,
6384           0.6901658670245e-07, 0.4325358994219e+01, 0.6275962395778e+01,
6385           0.9144536848998e-07, 0.1141826375363e+01, 0.6620890113188e+01,
6386           0.7205085037435e-07, 0.3624344170143e+01, 0.5296909721118e+00,
6387           0.7697874654176e-07, 0.5554257458998e+01, 0.1676215758509e+03,
6388 
6389           0.5197545738384e-07, 0.6251760961735e+01, 0.1807370494127e+02,
6390           0.5031345378608e-07, 0.2497341091913e+01, 0.4705732307012e+01,
6391           0.4527110205840e-07, 0.2335079920992e+01, 0.6309374173736e+01,
6392           0.4753355798089e-07, 0.7094148987474e+00, 0.5884926831456e+01,
6393           0.4296951977516e-07, 0.1101916352091e+01, 0.6681224869435e+01,
6394           0.3855341568387e-07, 0.1825495405486e+01, 0.5486777812467e+01,
6395           0.5253930970990e-07, 0.4424740687208e+01, 0.7860419393880e+01,
6396           0.4024630496471e-07, 0.5120498157053e+01, 0.1336797263425e+02,
6397           0.4061069791453e-07, 0.6029771435451e+01, 0.3930209696940e+01,
6398           0.3797883804205e-07, 0.4435193600836e+00, 0.3154687086868e+01,
6399 
6400           0.2933033225587e-07, 0.5124157356507e+01, 0.1059381944224e+01,
6401           0.3503000930426e-07, 0.5421830162065e+01, 0.6069776770667e+01,
6402           0.3670096214050e-07, 0.4582101667297e+01, 0.1219403291462e+02,
6403           0.2905609437008e-07, 0.1926566420072e+01, 0.1097707878456e+02,
6404           0.2466827821713e-07, 0.6090174539834e+00, 0.6496374930224e+01,
6405           0.2691647295332e-07, 0.1393432595077e+01, 0.2200391463820e+02,
6406           0.2150554667946e-07, 0.4308671715951e+01, 0.5643178611111e+01,
6407           0.2237481922680e-07, 0.8133968269414e+00, 0.8635942003952e+01,
6408           0.1817741038157e-07, 0.3755205127454e+01, 0.3340612434717e+01,
6409           0.2227820762132e-07, 0.2759558596664e+01, 0.1203646072878e+02,
6410 
6411           0.1944713772307e-07, 0.5699645869121e+01, 0.1179062909082e+02,
6412           0.1527340520662e-07, 0.1986749091746e+01, 0.3981490189893e+00,
6413           0.1577282574914e-07, 0.3205017217983e+01, 0.5088628793478e+01,
6414           0.1424738825424e-07, 0.6256747903666e+01, 0.2544314396739e+01,
6415           0.1616563121701e-07, 0.2601671259394e+00, 0.1729818233119e+02,
6416           0.1401210391692e-07, 0.4686939173506e+01, 0.7058598460518e+01,
6417           0.1488726974214e-07, 0.2815862451372e+01, 0.2593412433514e+02,
6418           0.1692626442388e-07, 0.4956894109797e+01, 0.1564752902480e+03,
6419           0.1123571582910e-07, 0.2381192697696e+01, 0.3738761453707e+01,
6420           0.9903308606317e-08, 0.4294851657684e+01, 0.9225539266174e+01,
6421 
6422           0.9174533187191e-08, 0.3075171510642e+01, 0.4164311961999e+01,
6423           0.8645985631457e-08, 0.5477534821633e+00, 0.8429241228195e+01,
6424          -0.1085876492688e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6425           0.9264309077815e-08, 0.5968571670097e+01, 0.7079373888424e+01,
6426           0.8243116984954e-08, 0.1489098777643e+01, 0.1044738781244e+02,
6427           0.8268102113708e-08, 0.3512977691983e+01, 0.1150676975667e+02,
6428           0.9043613988227e-08, 0.1290704408221e+00, 0.1101510648075e+02,
6429           0.7432912038789e-08, 0.1991086893337e+01, 0.2608790314060e+02,
6430           0.8586233727285e-08, 0.4238357924414e+01, 0.2986433403208e+02,
6431           0.7612230060131e-08, 0.2911090150166e+01, 0.4732030630302e+01,
6432 
6433           0.7097787751408e-08, 0.1908938392390e+01, 0.8031092209206e+01,
6434           0.7640237040175e-08, 0.6129219000168e+00, 0.7962980379786e+00,
6435           0.7070445688081e-08, 0.1380417036651e+01, 0.2146165377750e+01,
6436           0.7690770957702e-08, 0.1680504249084e+01, 0.2122839202813e+02,
6437           0.8051292542594e-08, 0.5127423484511e+01, 0.2942463415728e+01,
6438           0.5902709104515e-08, 0.2020274190917e+01, 0.7755226100720e+00,
6439           0.5134567496462e-08, 0.2606778676418e+01, 0.1256615170089e+02,
6440           0.5525802046102e-08, 0.1613011769663e+01, 0.8018209333619e+00,
6441           0.5880724784221e-08, 0.4604483417236e+01, 0.4690479774488e+01,
6442           0.5211699081370e-08, 0.5718964114193e+01, 0.8827390247185e+01,
6443 
6444           0.4891849573562e-08, 0.3689658932196e+01, 0.2132990797783e+00,
6445           0.5150246069997e-08, 0.4099769855122e+01, 0.6480980550449e+02,
6446           0.5102434319633e-08, 0.5660834602509e+01, 0.3379454372902e+02,
6447           0.5083405254252e-08, 0.9842221218974e+00, 0.4136910472696e+01,
6448           0.4206562585682e-08, 0.1341363634163e+00, 0.3128388763578e+01,
6449           0.4663249683579e-08, 0.8130132735866e+00, 0.5216580451554e+01,
6450           0.4099474416530e-08, 0.5791497770644e+01, 0.4265981595566e+00,
6451           0.4628251220767e-08, 0.1249802769331e+01, 0.1572083878776e+02,
6452           0.5024068728142e-08, 0.4795684802743e+01, 0.6290189305114e+01,
6453           0.5120234327758e-08, 0.3810420387208e+01, 0.5230807360890e+01,
6454 
6455           0.5524029815280e-08, 0.1029264714351e+01, 0.2397622045175e+03,
6456           0.4757415718860e-08, 0.3528044781779e+01, 0.1649636139783e+02,
6457           0.3915786131127e-08, 0.5593889282646e+01, 0.1589072916335e+01,
6458           0.4869053149991e-08, 0.3299636454433e+01, 0.7632943190217e+01,
6459           0.3649365703729e-08, 0.1286049002584e+01, 0.6206810014183e+01,
6460           0.3992493949002e-08, 0.3100307589464e+01, 0.2515860172507e+02,
6461           0.3320247477418e-08, 0.6212683940807e+01, 0.1216800268190e+02,
6462           0.3287123739696e-08, 0.4699118445928e+01, 0.7234794171227e+01,
6463           0.3472776811103e-08, 0.2630507142004e+01, 0.7342457794669e+01,
6464           0.3423253294767e-08, 0.2946432844305e+01, 0.9623688285163e+01,
6465 
6466           0.3896173898244e-08, 0.1224834179264e+01, 0.6438496133249e+01,
6467           0.3388455337924e-08, 0.1543807616351e+01, 0.1494531617769e+02,
6468           0.3062704716523e-08, 0.1191777572310e+01, 0.8662240327241e+01,
6469           0.3270075600400e-08, 0.5483498767737e+01, 0.1194447056968e+01,
6470           0.3101209215259e-08, 0.8000833804348e+00, 0.3772475342596e+02,
6471           0.2780883347311e-08, 0.4077980721888e+00, 0.5863591145557e+01,
6472           0.2903605931824e-08, 0.2617490302147e+01, 0.1965104848470e+02,
6473           0.2682014743119e-08, 0.2634703158290e+01, 0.7238675589263e+01,
6474           0.2534360108492e-08, 0.6102446114873e+01, 0.6836645152238e+01,
6475           0.2392564882509e-08, 0.3681820208691e+01, 0.5849364236221e+01,
6476 
6477           0.2656667254856e-08, 0.6216045388886e+01, 0.6133512519065e+01,
6478           0.2331242096773e-08, 0.5864949777744e+01, 0.4535059491685e+01,
6479           0.2287898363668e-08, 0.4566628532802e+01, 0.7477522907414e+01,
6480           0.2336944521306e-08, 0.2442722126930e+01, 0.1137170464392e+02,
6481           0.3156632236269e-08, 0.1626628050682e+01, 0.2509084901204e+03,
6482           0.2982612402766e-08, 0.2803604512609e+01, 0.1748016358760e+01,
6483           0.2774031674807e-08, 0.4654002897158e+01, 0.8223916695780e+02,
6484           0.2295236548638e-08, 0.4326518333253e+01, 0.3378142627421e+00,
6485           0.2190714699873e-08, 0.4519614578328e+01, 0.2908881142201e+02,
6486           0.2191495845045e-08, 0.3012626912549e+01, 0.1673046366289e+02,
6487 
6488           0.2492901628386e-08, 0.1290101424052e+00, 0.1543797956245e+03,
6489           0.1993778064319e-08, 0.3864046799414e+01, 0.1778984560711e+02,
6490           0.1898146479022e-08, 0.5053777235891e+01, 0.2042657109477e+02,
6491           0.1918280127634e-08, 0.2222470192548e+01, 0.4165496312290e+02,
6492           0.1916351061607e-08, 0.8719067257774e+00, 0.7737595720538e+02,
6493           0.1834720181466e-08, 0.4031491098040e+01, 0.2358125818164e+02,
6494           0.1249201523806e-08, 0.5938379466835e+01, 0.3301902111895e+02,
6495           0.1477304050539e-08, 0.6544722606797e+00, 0.9548094718417e+02,
6496           0.1264316431249e-08, 0.2059072853236e+01, 0.8399684731857e+02,
6497           0.1203526495039e-08, 0.3644813532605e+01, 0.4558517281984e+02,
6498 
6499           0.9221681059831e-09, 0.3241815055602e+01, 0.7805158573086e+02,
6500           0.7849278367646e-09, 0.5043812342457e+01, 0.5217580628120e+02,
6501           0.7983392077387e-09, 0.5000024502753e+01, 0.1501922143975e+03,
6502           0.7925395431654e-09, 0.1398734871821e-01, 0.9061773743175e+02,
6503           0.7640473285886e-09, 0.5067111723130e+01, 0.4951538251678e+02,
6504           0.5398937754482e-09, 0.5597382200075e+01, 0.1613385000004e+03,
6505           0.5626247550193e-09, 0.2601338209422e+01, 0.7318837597844e+02,
6506           0.5525197197855e-09, 0.5814832109256e+01, 0.1432335100216e+03,
6507           0.5407629837898e-09, 0.3384820609076e+01, 0.3230491187871e+03,
6508           0.3856739119801e-09, 0.1072391840473e+01, 0.2334791286671e+03,
6509 
6510           0.3856425239987e-09, 0.2369540393327e+01, 0.1739046517013e+03,
6511           0.4350867755983e-09, 0.5255575751082e+01, 0.1620484330494e+03,
6512           0.3844113924996e-09, 0.5482356246182e+01, 0.9757644180768e+02,
6513           0.2854869155431e-09, 0.9573634763143e+00, 0.1697170704744e+03,
6514           0.1719227671416e-09, 0.1887203025202e+01, 0.2265204242912e+03,
6515           0.1527846879755e-09, 0.3982183931157e+01, 0.3341954043900e+03,
6516           0.1128229264847e-09, 0.2787457156298e+01, 0.3119028331842e+03 };
6517 
6518     /* Sun-to-Earth, T^1, X */
6519       static final double e1x[] = {
6520           0.1234046326004e-05, 0.0000000000000e+00, 0.0000000000000e+00,
6521           0.5150068824701e-06, 0.6002664557501e+01, 0.1256615170089e+02,
6522           0.1290743923245e-07, 0.5959437664199e+01, 0.1884922755134e+02,
6523           0.1068615564952e-07, 0.2015529654209e+01, 0.6283075850446e+01,
6524           0.2079619142538e-08, 0.1732960531432e+01, 0.6279552690824e+01,
6525           0.2078009243969e-08, 0.4915604476996e+01, 0.6286599010068e+01,
6526           0.6206330058856e-09, 0.3616457953824e+00, 0.4705732307012e+01,
6527           0.5989335313746e-09, 0.3802607304474e+01, 0.6256777527156e+01,
6528           0.5958495663840e-09, 0.2845866560031e+01, 0.6309374173736e+01,
6529           0.4866923261539e-09, 0.5213203771824e+01, 0.7755226100720e+00,
6530 
6531           0.4267785823142e-09, 0.4368189727818e+00, 0.1059381944224e+01,
6532           0.4610675141648e-09, 0.1837249181372e-01, 0.7860419393880e+01,
6533           0.3626989993973e-09, 0.2161590545326e+01, 0.5753384878334e+01,
6534           0.3563071194389e-09, 0.1452631954746e+01, 0.5884926831456e+01,
6535           0.3557015642807e-09, 0.4470593393054e+01, 0.6812766822558e+01,
6536           0.3210412089122e-09, 0.5195926078314e+01, 0.6681224869435e+01,
6537           0.2875473577986e-09, 0.5916256610193e+01, 0.2513230340178e+02,
6538           0.2842913681629e-09, 0.1149902426047e+01, 0.6127655567643e+01,
6539           0.2751248215916e-09, 0.5502088574662e+01, 0.6438496133249e+01,
6540           0.2481432881127e-09, 0.2921989846637e+01, 0.5486777812467e+01,
6541 
6542           0.2059885976560e-09, 0.3718070376585e+01, 0.7079373888424e+01,
6543           0.2015522342591e-09, 0.5979395259740e+01, 0.6290189305114e+01,
6544           0.1995364084253e-09, 0.6772087985494e+00, 0.6275962395778e+01,
6545           0.1957436436943e-09, 0.2899210654665e+01, 0.5507553240374e+01,
6546           0.1651609818948e-09, 0.6228206482192e+01, 0.1150676975667e+02,
6547           0.1822980550699e-09, 0.1469348746179e+01, 0.1179062909082e+02,
6548           0.1675223159760e-09, 0.3813910555688e+01, 0.7058598460518e+01,
6549           0.1706491764745e-09, 0.3004380506684e+00, 0.7113454667900e-02,
6550           0.1392952362615e-09, 0.1440393973406e+01, 0.7962980379786e+00,
6551           0.1209868266342e-09, 0.4150425791727e+01, 0.4694002934110e+01,
6552 
6553           0.1009827202611e-09, 0.3290040429843e+01, 0.3738761453707e+01,
6554           0.1047261388602e-09, 0.4229590090227e+01, 0.6282095334605e+01,
6555           0.1047006652004e-09, 0.2418967680575e+01, 0.6284056366286e+01,
6556           0.9609993143095e-10, 0.4627943659201e+01, 0.6069776770667e+01,
6557           0.9590900593873e-10, 0.1894393939924e+01, 0.4136910472696e+01,
6558           0.9146249188071e-10, 0.2010647519562e+01, 0.6496374930224e+01,
6559           0.8545274480290e-10, 0.5529846956226e-01, 0.1194447056968e+01,
6560           0.8224377881194e-10, 0.1254304102174e+01, 0.1589072916335e+01,
6561           0.6183529510410e-10, 0.3360862168815e+01, 0.8827390247185e+01,
6562           0.6259255147141e-10, 0.4755628243179e+01, 0.8429241228195e+01,
6563 
6564           0.5539291694151e-10, 0.5371746955142e+01, 0.4933208510675e+01,
6565           0.7328259466314e-10, 0.4927699613906e+00, 0.4535059491685e+01,
6566           0.6017835843560e-10, 0.5776682001734e-01, 0.1255903824622e+02,
6567           0.7079827775243e-10, 0.4395059432251e+01, 0.5088628793478e+01,
6568           0.5170358878213e-10, 0.5154062619954e+01, 0.1176985366291e+02,
6569           0.4872301838682e-10, 0.6289611648973e+00, 0.6040347114260e+01,
6570           0.5249869411058e-10, 0.5617272046949e+01, 0.3154687086868e+01,
6571           0.4716172354411e-10, 0.3965901800877e+01, 0.5331357529664e+01,
6572           0.4871214940964e-10, 0.4627507050093e+01, 0.1256967486051e+02,
6573           0.4598076850751e-10, 0.6023631226459e+01, 0.6525804586632e+01,
6574 
6575           0.4562196089485e-10, 0.4138562084068e+01, 0.3930209696940e+01,
6576           0.4325493872224e-10, 0.1330845906564e+01, 0.7632943190217e+01,
6577           0.5673781176748e-10, 0.2558752615657e+01, 0.5729506548653e+01,
6578           0.3961436642503e-10, 0.2728071734630e+01, 0.7234794171227e+01,
6579           0.5101868209058e-10, 0.4113444965144e+01, 0.6836645152238e+01,
6580           0.5257043167676e-10, 0.6195089830590e+01, 0.8031092209206e+01,
6581           0.5076613989393e-10, 0.2305124132918e+01, 0.7477522907414e+01,
6582           0.3342169352778e-10, 0.5415998155071e+01, 0.1097707878456e+02,
6583           0.3545881983591e-10, 0.3727160564574e+01, 0.4164311961999e+01,
6584           0.3364063738599e-10, 0.2901121049204e+00, 0.1137170464392e+02,
6585 
6586           0.3357039670776e-10, 0.1652229354331e+01, 0.5223693906222e+01,
6587           0.4307412268687e-10, 0.4938909587445e+01, 0.1592596075957e+01,
6588           0.3405769115435e-10, 0.2408890766511e+01, 0.3128388763578e+01,
6589           0.3001926198480e-10, 0.4862239006386e+01, 0.1748016358760e+01,
6590           0.2778264787325e-10, 0.5241168661353e+01, 0.7342457794669e+01,
6591           0.2676159480666e-10, 0.3423593942199e+01, 0.2146165377750e+01,
6592           0.2954273399939e-10, 0.1881721265406e+01, 0.5368044267797e+00,
6593           0.3309362888795e-10, 0.1931525677349e+01, 0.8018209333619e+00,
6594           0.2810283608438e-10, 0.2414659495050e+01, 0.5225775174439e+00,
6595           0.3378045637764e-10, 0.4238019163430e+01, 0.1554202828031e+00,
6596 
6597           0.2558134979840e-10, 0.1828225235805e+01, 0.5230807360890e+01,
6598           0.2273755578447e-10, 0.5858184283998e+01, 0.7084896783808e+01,
6599           0.2294176037690e-10, 0.4514589779057e+01, 0.1726015463500e+02,
6600           0.2533506099435e-10, 0.2355717851551e+01, 0.5216580451554e+01,
6601           0.2716685375812e-10, 0.2221003625100e+01, 0.8635942003952e+01,
6602           0.2419043435198e-10, 0.5955704951635e+01, 0.4690479774488e+01,
6603           0.2521232544812e-10, 0.1395676848521e+01, 0.5481254917084e+01,
6604           0.2630195021491e-10, 0.5727468918743e+01, 0.2629832328990e-01,
6605           0.2548395840944e-10, 0.2628351859400e-03, 0.1349867339771e+01 };
6606 
6607     /* Sun-to-Earth, T^1, Y */
6608       static final double e1y[] = {
6609           0.9304690546528e-06, 0.0000000000000e+00, 0.0000000000000e+00,
6610           0.5150715570663e-06, 0.4431807116294e+01, 0.1256615170089e+02,
6611           0.1290825411056e-07, 0.4388610039678e+01, 0.1884922755134e+02,
6612           0.4645466665386e-08, 0.5827263376034e+01, 0.6283075850446e+01,
6613           0.2079625310718e-08, 0.1621698662282e+00, 0.6279552690824e+01,
6614           0.2078189850907e-08, 0.3344713435140e+01, 0.6286599010068e+01,
6615           0.6207190138027e-09, 0.5074049319576e+01, 0.4705732307012e+01,
6616           0.5989826532569e-09, 0.2231842216620e+01, 0.6256777527156e+01,
6617           0.5961360812618e-09, 0.1274975769045e+01, 0.6309374173736e+01,
6618           0.4874165471016e-09, 0.3642277426779e+01, 0.7755226100720e+00,
6619 
6620           0.4283834034360e-09, 0.5148765510106e+01, 0.1059381944224e+01,
6621           0.4652389287529e-09, 0.4715794792175e+01, 0.7860419393880e+01,
6622           0.3751707476401e-09, 0.6617207370325e+00, 0.5753384878334e+01,
6623           0.3559998806198e-09, 0.6155548875404e+01, 0.5884926831456e+01,
6624           0.3558447558857e-09, 0.2898827297664e+01, 0.6812766822558e+01,
6625           0.3211116927106e-09, 0.3625813502509e+01, 0.6681224869435e+01,
6626           0.2875609914672e-09, 0.4345435813134e+01, 0.2513230340178e+02,
6627           0.2843109704069e-09, 0.5862263940038e+01, 0.6127655567643e+01,
6628           0.2744676468427e-09, 0.3926419475089e+01, 0.6438496133249e+01,
6629           0.2481285237789e-09, 0.1351976572828e+01, 0.5486777812467e+01,
6630 
6631           0.2060338481033e-09, 0.2147556998591e+01, 0.7079373888424e+01,
6632           0.2015822358331e-09, 0.4408358972216e+01, 0.6290189305114e+01,
6633           0.2001195944195e-09, 0.5385829822531e+01, 0.6275962395778e+01,
6634           0.1953667642377e-09, 0.1304933746120e+01, 0.5507553240374e+01,
6635           0.1839744078713e-09, 0.6173567228835e+01, 0.1179062909082e+02,
6636           0.1643334294845e-09, 0.4635942997523e+01, 0.1150676975667e+02,
6637           0.1768051018652e-09, 0.5086283558874e+01, 0.7113454667900e-02,
6638           0.1674874205489e-09, 0.2243332137241e+01, 0.7058598460518e+01,
6639           0.1421445397609e-09, 0.6186899771515e+01, 0.7962980379786e+00,
6640           0.1255163958267e-09, 0.5730238465658e+01, 0.4694002934110e+01,
6641 
6642           0.1013945281961e-09, 0.1726055228402e+01, 0.3738761453707e+01,
6643           0.1047294335852e-09, 0.2658801228129e+01, 0.6282095334605e+01,
6644           0.1047103879392e-09, 0.8481047835035e+00, 0.6284056366286e+01,
6645           0.9530343962826e-10, 0.3079267149859e+01, 0.6069776770667e+01,
6646           0.9604637611690e-10, 0.3258679792918e+00, 0.4136910472696e+01,
6647           0.9153518537177e-10, 0.4398599886584e+00, 0.6496374930224e+01,
6648           0.8562458214922e-10, 0.4772686794145e+01, 0.1194447056968e+01,
6649           0.8232525360654e-10, 0.5966220721679e+01, 0.1589072916335e+01,
6650           0.6150223411438e-10, 0.1780985591923e+01, 0.8827390247185e+01,
6651           0.6272087858000e-10, 0.3184305429012e+01, 0.8429241228195e+01,
6652 
6653           0.5540476311040e-10, 0.3801260595433e+01, 0.4933208510675e+01,
6654           0.7331901699361e-10, 0.5205948591865e+01, 0.4535059491685e+01,
6655           0.6018528702791e-10, 0.4770139083623e+01, 0.1255903824622e+02,
6656           0.5150530724804e-10, 0.3574796899585e+01, 0.1176985366291e+02,
6657           0.6471933741811e-10, 0.2679787266521e+01, 0.5088628793478e+01,
6658           0.5317460644174e-10, 0.9528763345494e+00, 0.3154687086868e+01,
6659           0.4832187748783e-10, 0.5329322498232e+01, 0.6040347114260e+01,
6660           0.4716763555110e-10, 0.2395235316466e+01, 0.5331357529664e+01,
6661           0.4871509139861e-10, 0.3056663648823e+01, 0.1256967486051e+02,
6662           0.4598417696768e-10, 0.4452762609019e+01, 0.6525804586632e+01,
6663 
6664           0.5674189533175e-10, 0.9879680872193e+00, 0.5729506548653e+01,
6665           0.4073560328195e-10, 0.5939127696986e+01, 0.7632943190217e+01,
6666           0.5040994945359e-10, 0.4549875824510e+01, 0.8031092209206e+01,
6667           0.5078185134679e-10, 0.7346659893982e+00, 0.7477522907414e+01,
6668           0.3769343537061e-10, 0.1071317188367e+01, 0.7234794171227e+01,
6669           0.4980331365299e-10, 0.2500345341784e+01, 0.6836645152238e+01,
6670           0.3458236594757e-10, 0.3825159450711e+01, 0.1097707878456e+02,
6671           0.3578859493602e-10, 0.5299664791549e+01, 0.4164311961999e+01,
6672           0.3370504646419e-10, 0.5002316301593e+01, 0.1137170464392e+02,
6673           0.3299873338428e-10, 0.2526123275282e+01, 0.3930209696940e+01,
6674 
6675           0.4304917318409e-10, 0.3368078557132e+01, 0.1592596075957e+01,
6676           0.3402418753455e-10, 0.8385495425800e+00, 0.3128388763578e+01,
6677           0.2778460572146e-10, 0.3669905203240e+01, 0.7342457794669e+01,
6678           0.2782710128902e-10, 0.2691664812170e+00, 0.1748016358760e+01,
6679           0.2711725179646e-10, 0.4707487217718e+01, 0.5296909721118e+00,
6680           0.2981760946340e-10, 0.3190260867816e+00, 0.5368044267797e+00,
6681           0.2811672977772e-10, 0.3196532315372e+01, 0.7084896783808e+01,
6682           0.2863454474467e-10, 0.2263240324780e+00, 0.5223693906222e+01,
6683           0.3333464634051e-10, 0.3498451685065e+01, 0.8018209333619e+00,
6684           0.3312991747609e-10, 0.5839154477412e+01, 0.1554202828031e+00,
6685 
6686           0.2813255564006e-10, 0.8268044346621e+00, 0.5225775174439e+00,
6687           0.2665098083966e-10, 0.3934021725360e+01, 0.5216580451554e+01,
6688           0.2349795705216e-10, 0.5197620913779e+01, 0.2146165377750e+01,
6689           0.2330352293961e-10, 0.2984999231807e+01, 0.1726015463500e+02,
6690           0.2728001683419e-10, 0.6521679638544e+00, 0.8635942003952e+01,
6691           0.2484061007669e-10, 0.3468955561097e+01, 0.5230807360890e+01,
6692           0.2646328768427e-10, 0.1013724533516e+01, 0.2629832328990e-01,
6693           0.2518630264831e-10, 0.6108081057122e+01, 0.5481254917084e+01,
6694           0.2421901455384e-10, 0.1651097776260e+01, 0.1349867339771e+01,
6695           0.6348533267831e-11, 0.3220226560321e+01, 0.8433466158131e+02 };
6696 
6697     /* Sun-to-Earth, T^1, Z */
6698       static final double e1z[] = {
6699           0.2278290449966e-05, 0.3413716033863e+01, 0.6283075850446e+01,
6700           0.5429458209830e-07, 0.0000000000000e+00, 0.0000000000000e+00,
6701           0.1903240492525e-07, 0.3370592358297e+01, 0.1256615170089e+02,
6702           0.2385409276743e-09, 0.3327914718416e+01, 0.1884922755134e+02,
6703           0.8676928342573e-10, 0.1824006811264e+01, 0.5223693906222e+01,
6704           0.7765442593544e-10, 0.3888564279247e+01, 0.5507553240374e+01,
6705           0.7066158332715e-10, 0.5194267231944e+01, 0.2352866153506e+01,
6706           0.7092175288657e-10, 0.2333246960021e+01, 0.8399684731857e+02,
6707           0.5357582213535e-10, 0.2224031176619e+01, 0.5296909721118e+00,
6708           0.3828035865021e-10, 0.2156710933584e+01, 0.6279552690824e+01,
6709 
6710           0.3824857220427e-10, 0.1529755219915e+01, 0.6286599010068e+01,
6711           0.3286995181628e-10, 0.4879512900483e+01, 0.1021328554739e+02 };
6712 
6713     /* Sun-to-Earth, T^2, X */
6714       static final double e2x[] = {
6715          -0.4143818297913e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6716           0.2171497694435e-10, 0.4398225628264e+01, 0.1256615170089e+02,
6717           0.9845398442516e-11, 0.2079720838384e+00, 0.6283075850446e+01,
6718           0.9256833552682e-12, 0.4191264694361e+01, 0.1884922755134e+02,
6719           0.1022049384115e-12, 0.5381133195658e+01, 0.8399684731857e+02 };
6720 
6721     /* Sun-to-Earth, T^2, Y */
6722       static final double e2y[] = {
6723           0.5063375872532e-10, 0.0000000000000e+00, 0.0000000000000e+00,
6724           0.2173815785980e-10, 0.2827805833053e+01, 0.1256615170089e+02,
6725           0.1010231999920e-10, 0.4634612377133e+01, 0.6283075850446e+01,
6726           0.9259745317636e-12, 0.2620612076189e+01, 0.1884922755134e+02,
6727           0.1022202095812e-12, 0.3809562326066e+01, 0.8399684731857e+02 };
6728 
6729     /* Sun-to-Earth, T^2, Z */
6730       static final double e2z[] = {
6731           0.9722666114891e-10, 0.5152219582658e+01, 0.6283075850446e+01,
6732          -0.3494819171909e-11, 0.0000000000000e+00, 0.0000000000000e+00,
6733           0.6713034376076e-12, 0.6440188750495e+00, 0.1256615170089e+02 };
6734 
6735     }
6736       //subclassed the 
6737       private static class SSB {
6738     /* SSB-to-Sun, T^0, X */
6739       static final double s0x[] = {
6740           0.4956757536410e-02, 0.3741073751789e+01, 0.5296909721118e+00,
6741           0.2718490072522e-02, 0.4016011511425e+01, 0.2132990797783e+00,
6742           0.1546493974344e-02, 0.2170528330642e+01, 0.3813291813120e-01,
6743           0.8366855276341e-03, 0.2339614075294e+01, 0.7478166569050e-01,
6744           0.2936777942117e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6745           0.1201317439469e-03, 0.4090736353305e+01, 0.1059381944224e+01,
6746           0.7578550887230e-04, 0.3241518088140e+01, 0.4265981595566e+00,
6747           0.1941787367773e-04, 0.1012202064330e+01, 0.2061856251104e+00,
6748           0.1889227765991e-04, 0.3892520416440e+01, 0.2204125344462e+00,
6749           0.1937896968613e-04, 0.4797779441161e+01, 0.1495633313810e+00,
6750 
6751           0.1434506110873e-04, 0.3868960697933e+01, 0.5225775174439e+00,
6752           0.1406659911580e-04, 0.4759766557397e+00, 0.5368044267797e+00,
6753           0.1179022300202e-04, 0.7774961520598e+00, 0.7626583626240e-01,
6754           0.8085864460959e-05, 0.3254654471465e+01, 0.3664874755930e-01,
6755           0.7622752967615e-05, 0.4227633103489e+01, 0.3961708870310e-01,
6756           0.6209171139066e-05, 0.2791828325711e+00, 0.7329749511860e-01,
6757           0.4366435633970e-05, 0.4440454875925e+01, 0.1589072916335e+01,
6758           0.3792124889348e-05, 0.5156393842356e+01, 0.7113454667900e-02,
6759           0.3154548963402e-05, 0.6157005730093e+01, 0.4194847048887e+00,
6760           0.3088359882942e-05, 0.2494567553163e+01, 0.6398972393349e+00,
6761 
6762           0.2788440902136e-05, 0.4934318747989e+01, 0.1102062672231e+00,
6763           0.3039928456376e-05, 0.4895077702640e+01, 0.6283075850446e+01,
6764           0.2272258457679e-05, 0.5278394064764e+01, 0.1030928125552e+00,
6765           0.2162007057957e-05, 0.5802978019099e+01, 0.3163918923335e+00,
6766           0.1767632855737e-05, 0.3415346595193e-01, 0.1021328554739e+02,
6767           0.1349413459362e-05, 0.2001643230755e+01, 0.1484170571900e-02,
6768           0.1170141900476e-05, 0.2424750491620e+01, 0.6327837846670e+00,
6769           0.1054355266820e-05, 0.3123311487576e+01, 0.4337116142245e+00,
6770           0.9800822461610e-06, 0.3026258088130e+01, 0.1052268489556e+01,
6771           0.1091203749931e-05, 0.3157811670347e+01, 0.1162474756779e+01,
6772 
6773           0.6960236715913e-06, 0.8219570542313e+00, 0.1066495398892e+01,
6774           0.5689257296909e-06, 0.1323052375236e+01, 0.9491756770005e+00,
6775           0.6613172135802e-06, 0.2765348881598e+00, 0.8460828644453e+00,
6776           0.6277702517571e-06, 0.5794064466382e+01, 0.1480791608091e+00,
6777           0.6304884066699e-06, 0.7323555380787e+00, 0.2243449970715e+00,
6778           0.4897850467382e-06, 0.3062464235399e+01, 0.3340612434717e+01,
6779           0.3759148598786e-06, 0.4588290469664e+01, 0.3516457698740e-01,
6780           0.3110520548195e-06, 0.1374299536572e+01, 0.6373574839730e-01,
6781           0.3064708359780e-06, 0.4222267485047e+01, 0.1104591729320e-01,
6782           0.2856347168241e-06, 0.3714202944973e+01, 0.1510475019529e+00,
6783 
6784           0.2840945514288e-06, 0.2847972875882e+01, 0.4110125927500e-01,
6785           0.2378951599405e-06, 0.3762072563388e+01, 0.2275259891141e+00,
6786           0.2714229481417e-06, 0.1036049980031e+01, 0.2535050500000e-01,
6787           0.2323551717307e-06, 0.4682388599076e+00, 0.8582758298370e-01,
6788           0.1881790512219e-06, 0.4790565425418e+01, 0.2118763888447e+01,
6789           0.2261353968371e-06, 0.1669144912212e+01, 0.7181332454670e-01,
6790           0.2214546389848e-06, 0.3937717281614e+01, 0.2968341143800e-02,
6791           0.2184915594933e-06, 0.1129169845099e+00, 0.7775000683430e-01,
6792           0.2000164937936e-06, 0.4030009638488e+01, 0.2093666171530e+00,
6793           0.1966105136719e-06, 0.8745955786834e+00, 0.2172315424036e+00,
6794 
6795           0.1904742332624e-06, 0.5919743598964e+01, 0.2022531624851e+00,
6796           0.1657399705031e-06, 0.2549141484884e+01, 0.7358765972222e+00,
6797           0.1574070533987e-06, 0.5277533020230e+01, 0.7429900518901e+00,
6798           0.1832261651039e-06, 0.3064688127777e+01, 0.3235053470014e+00,
6799           0.1733615346569e-06, 0.3011432799094e+01, 0.1385174140878e+00,
6800           0.1549124014496e-06, 0.4005569132359e+01, 0.5154640627760e+00,
6801           0.1637044713838e-06, 0.1831375966632e+01, 0.8531963191132e+00,
6802           0.1123420082383e-06, 0.1180270407578e+01, 0.1990721704425e+00,
6803           0.1083754165740e-06, 0.3414101320863e+00, 0.5439178814476e+00,
6804           0.1156638012655e-06, 0.6130479452594e+00, 0.5257585094865e+00,
6805 
6806           0.1142548785134e-06, 0.3724761948846e+01, 0.5336234347371e+00,
6807           0.7921463895965e-07, 0.2435425589361e+01, 0.1478866649112e+01,
6808           0.7428600285231e-07, 0.3542144398753e+01, 0.2164800718209e+00,
6809           0.8323211246747e-07, 0.3525058072354e+01, 0.1692165728891e+01,
6810           0.7257595116312e-07, 0.1364299431982e+01, 0.2101180877357e+00,
6811           0.7111185833236e-07, 0.2460478875808e+01, 0.4155522422634e+00,
6812           0.6868090383716e-07, 0.4397327670704e+01, 0.1173197218910e+00,
6813           0.7226419974175e-07, 0.4042647308905e+01, 0.1265567569334e+01,
6814           0.6955642383177e-07, 0.2865047906085e+01, 0.9562891316684e+00,
6815           0.7492139296331e-07, 0.5014278994215e+01, 0.1422690933580e-01,
6816 
6817           0.6598363128857e-07, 0.2376730020492e+01, 0.6470106940028e+00,
6818           0.7381147293385e-07, 0.3272990384244e+01, 0.1581959461667e+01,
6819           0.6402909624032e-07, 0.5302290955138e+01, 0.9597935788730e-01,
6820           0.6237454263857e-07, 0.5444144425332e+01, 0.7084920306520e-01,
6821           0.5241198544016e-07, 0.4215359579205e+01, 0.5265099800692e+00,
6822           0.5144463853918e-07, 0.1218916689916e+00, 0.5328719641544e+00,
6823           0.5868164772299e-07, 0.2369402002213e+01, 0.7871412831580e-01,
6824           0.6233195669151e-07, 0.1254922242403e+01, 0.2608790314060e+02,
6825           0.6068463791422e-07, 0.5679713760431e+01, 0.1114304132498e+00,
6826           0.4359361135065e-07, 0.6097219641646e+00, 0.1375773836557e+01,
6827 
6828           0.4686510366826e-07, 0.4786231041431e+01, 0.1143987543936e+00,
6829           0.3758977287225e-07, 0.1167368068139e+01, 0.1596186371003e+01,
6830           0.4282051974778e-07, 0.1519471064319e+01, 0.2770348281756e+00,
6831           0.5153765386113e-07, 0.1860532322984e+01, 0.2228608264996e+00,
6832           0.4575129387188e-07, 0.7632857887158e+00, 0.1465949902372e+00,
6833           0.3326844933286e-07, 0.1298219485285e+01, 0.5070101000000e-01,
6834           0.3748617450984e-07, 0.1046510321062e+01, 0.4903339079539e+00,
6835           0.2816756661499e-07, 0.3434522346190e+01, 0.2991266627620e+00,
6836           0.3412750405039e-07, 0.2523766270318e+01, 0.3518164938661e+00,
6837           0.2655796761776e-07, 0.2904422260194e+01, 0.6256703299991e+00,
6838 
6839           0.2963597929458e-07, 0.5923900431149e+00, 0.1099462426779e+00,
6840           0.2539523734781e-07, 0.4851947722567e+01, 0.1256615170089e+02,
6841           0.2283087914139e-07, 0.3400498595496e+01, 0.6681224869435e+01,
6842           0.2321309799331e-07, 0.5789099148673e+01, 0.3368040641550e-01,
6843           0.2549657649750e-07, 0.3991856479792e-01, 0.1169588211447e+01,
6844           0.2290462303977e-07, 0.2788567577052e+01, 0.1045155034888e+01,
6845           0.1945398522914e-07, 0.3290896998176e+01, 0.1155361302111e+01,
6846           0.1849171512638e-07, 0.2698060129367e+01, 0.4452511715700e-02,
6847           0.1647199834254e-07, 0.3016735644085e+01, 0.4408250688924e+00,
6848           0.1529530765273e-07, 0.5573043116178e+01, 0.6521991896920e-01,
6849 
6850           0.1433199339978e-07, 0.1481192356147e+01, 0.9420622223326e+00,
6851           0.1729134193602e-07, 0.1422817538933e+01, 0.2108507877249e+00,
6852           0.1716463931346e-07, 0.3469468901855e+01, 0.2157473718317e+00,
6853           0.1391206061378e-07, 0.6122436220547e+01, 0.4123712502208e+00,
6854           0.1404746661924e-07, 0.1647765641936e+01, 0.4258542984690e-01,
6855           0.1410452399455e-07, 0.5989729161964e+01, 0.2258291676434e+00,
6856           0.1089828772168e-07, 0.2833705509371e+01, 0.4226656969313e+00,
6857           0.1047374564948e-07, 0.5090690007331e+00, 0.3092784376656e+00,
6858           0.1358279126532e-07, 0.5128990262836e+01, 0.7923417740620e-01,
6859           0.1020456476148e-07, 0.9632772880808e+00, 0.1456308687557e+00,
6860 
6861           0.1033428735328e-07, 0.3223779318418e+01, 0.1795258541446e+01,
6862           0.1412435841540e-07, 0.2410271572721e+01, 0.1525316725248e+00,
6863           0.9722759371574e-08, 0.2333531395690e+01, 0.8434341241180e-01,
6864           0.9657334084704e-08, 0.6199270974168e+01, 0.1272681024002e+01,
6865           0.1083641148690e-07, 0.2864222292929e+01, 0.7032915397480e-01,
6866           0.1067318403838e-07, 0.5833458866568e+00, 0.2123349582968e+00,
6867           0.1062366201976e-07, 0.4307753989494e+01, 0.2142632012598e+00,
6868           0.1236364149266e-07, 0.2873917870593e+01, 0.1847279083684e+00,
6869           0.1092759489593e-07, 0.2959887266733e+01, 0.1370332435159e+00,
6870           0.8912069362899e-08, 0.5141213702562e+01, 0.2648454860559e+01,
6871 
6872           0.9656467707970e-08, 0.4532182462323e+01, 0.4376440768498e+00,
6873           0.8098386150135e-08, 0.2268906338379e+01, 0.2880807454688e+00,
6874           0.7857714675000e-08, 0.4055544260745e+01, 0.2037373330570e+00,
6875           0.7288455940646e-08, 0.5357901655142e+01, 0.1129145838217e+00,
6876           0.9450595950552e-08, 0.4264926963939e+01, 0.5272426800584e+00,
6877           0.9381718247537e-08, 0.7489366976576e-01, 0.5321392641652e+00,
6878           0.7079052646038e-08, 0.1923311052874e+01, 0.6288513220417e+00,
6879           0.9259004415344e-08, 0.2970256853438e+01, 0.1606092486742e+00,
6880           0.8259801499742e-08, 0.3327056314697e+01, 0.8389694097774e+00,
6881           0.6476334355779e-08, 0.2954925505727e+01, 0.2008557621224e+01,
6882 
6883           0.5984021492007e-08, 0.9138753105829e+00, 0.2042657109477e+02,
6884           0.5989546863181e-08, 0.3244464082031e+01, 0.2111650433779e+01,
6885           0.6233108606023e-08, 0.4995232638403e+00, 0.4305306221819e+00,
6886           0.6877299149965e-08, 0.2834987233449e+01, 0.9561746721300e-02,
6887           0.8311234227190e-08, 0.2202951835758e+01, 0.3801276407308e+00,
6888           0.6599472832414e-08, 0.4478581462618e+01, 0.1063314406849e+01,
6889           0.6160491096549e-08, 0.5145858696411e+01, 0.1368660381889e+01,
6890           0.6164772043891e-08, 0.3762976697911e+00, 0.4234171675140e+00,
6891           0.6363248684450e-08, 0.3162246718685e+01, 0.1253008786510e-01,
6892           0.6448587520999e-08, 0.3442693302119e+01, 0.5287268506303e+00,
6893 
6894           0.6431662283977e-08, 0.8977549136606e+00, 0.5306550935933e+00,
6895           0.6351223158474e-08, 0.4306447410369e+01, 0.5217580628120e+02,
6896           0.5476721393451e-08, 0.3888529177855e+01, 0.2221856701002e+01,
6897           0.5341772572619e-08, 0.2655560662512e+01, 0.7466759693650e-01,
6898           0.5337055758302e-08, 0.5164990735946e+01, 0.7489573444450e-01,
6899           0.5373120816787e-08, 0.6041214553456e+01, 0.1274714967946e+00,
6900           0.5392351705426e-08, 0.9177763485932e+00, 0.1055449481598e+01,
6901           0.6688495850205e-08, 0.3089608126937e+01, 0.2213766559277e+00,
6902           0.5072003660362e-08, 0.4311316541553e+01, 0.2132517061319e+00,
6903           0.5070726650455e-08, 0.5790675464444e+00, 0.2133464534247e+00,
6904 
6905           0.5658012950032e-08, 0.2703945510675e+01, 0.7287631425543e+00,
6906           0.4835509924854e-08, 0.2975422976065e+01, 0.7160067364790e-01,
6907           0.6479821978012e-08, 0.1324168733114e+01, 0.2209183458640e-01,
6908           0.6230636494980e-08, 0.2860103632836e+01, 0.3306188016693e+00,
6909           0.4649239516213e-08, 0.4832259763403e+01, 0.7796265773310e-01,
6910           0.6487325792700e-08, 0.2726165825042e+01, 0.3884652414254e+00,
6911           0.4682823682770e-08, 0.6966602455408e+00, 0.1073608853559e+01,
6912           0.5704230804976e-08, 0.5669634104606e+01, 0.8731175355560e-01,
6913           0.6125413585489e-08, 0.1513386538915e+01, 0.7605151500000e-01,
6914           0.6035825038187e-08, 0.1983509168227e+01, 0.9846002785331e+00,
6915 
6916           0.4331123462303e-08, 0.2782892992807e+01, 0.4297791515992e+00,
6917           0.4681107685143e-08, 0.5337232886836e+01, 0.2127790306879e+00,
6918           0.4669105829655e-08, 0.5837133792160e+01, 0.2138191288687e+00,
6919           0.5138823602365e-08, 0.3080560200507e+01, 0.7233337363710e-01,
6920           0.4615856664534e-08, 0.1661747897471e+01, 0.8603097737811e+00,
6921           0.4496916702197e-08, 0.2112508027068e+01, 0.7381754420900e-01,
6922           0.4278479042945e-08, 0.5716528462627e+01, 0.7574578717200e-01,
6923           0.3840525503932e-08, 0.6424172726492e+00, 0.3407705765729e+00,
6924           0.4866636509685e-08, 0.4919244697715e+01, 0.7722995774390e-01,
6925           0.3526100639296e-08, 0.2550821052734e+01, 0.6225157782540e-01,
6926 
6927           0.3939558488075e-08, 0.3939331491710e+01, 0.5268983110410e-01,
6928           0.4041268772576e-08, 0.2275337571218e+01, 0.3503323232942e+00,
6929           0.3948761842853e-08, 0.1999324200790e+01, 0.1451108196653e+00,
6930           0.3258394550029e-08, 0.9121001378200e+00, 0.5296435984654e+00,
6931           0.3257897048761e-08, 0.3428428660869e+01, 0.5297383457582e+00,
6932           0.3842559031298e-08, 0.6132927720035e+01, 0.9098186128426e+00,
6933           0.3109920095448e-08, 0.7693650193003e+00, 0.3932462625300e-02,
6934           0.3132237775119e-08, 0.3621293854908e+01, 0.2346394437820e+00,
6935           0.3942189421510e-08, 0.4841863659733e+01, 0.3180992042600e-02,
6936           0.3796972285340e-08, 0.1814174994268e+01, 0.1862120789403e+00,
6937 
6938           0.3995640233688e-08, 0.1386990406091e+01, 0.4549093064213e+00,
6939           0.2875013727414e-08, 0.9178318587177e+00, 0.1905464808669e+01,
6940           0.3073719932844e-08, 0.2688923811835e+01, 0.3628624111593e+00,
6941           0.2731016580075e-08, 0.1188259127584e+01, 0.2131850110243e+00,
6942           0.2729549896546e-08, 0.3702160634273e+01, 0.2134131485323e+00,
6943           0.3339372892449e-08, 0.7199163960331e+00, 0.2007689919132e+00,
6944           0.2898833764204e-08, 0.1916709364999e+01, 0.5291709230214e+00,
6945           0.2894536549362e-08, 0.2424043195547e+01, 0.5302110212022e+00,
6946           0.3096872473843e-08, 0.4445894977497e+01, 0.2976424921901e+00,
6947           0.2635672326810e-08, 0.3814366984117e+01, 0.1485980103780e+01,
6948 
6949           0.3649302697001e-08, 0.2924200596084e+01, 0.6044726378023e+00,
6950           0.3127954585895e-08, 0.1842251648327e+01, 0.1084620721060e+00,
6951           0.2616040173947e-08, 0.4155841921984e+01, 0.1258454114666e+01,
6952           0.2597395859860e-08, 0.1158045978874e+00, 0.2103781122809e+00,
6953           0.2593286172210e-08, 0.4771850408691e+01, 0.2162200472757e+00,
6954           0.2481823585747e-08, 0.4608842558889e+00, 0.1062562936266e+01,
6955           0.2742219550725e-08, 0.1538781127028e+01, 0.5651155736444e+00,
6956           0.3199558469610e-08, 0.3226647822878e+00, 0.7036329877322e+00,
6957           0.2666088542957e-08, 0.1967991731219e+00, 0.1400015846597e+00,
6958           0.2397067430580e-08, 0.3707036669873e+01, 0.2125476091956e+00,
6959 
6960           0.2376570772738e-08, 0.1182086628042e+01, 0.2140505503610e+00,
6961           0.2547228007887e-08, 0.4906256820629e+01, 0.1534957940063e+00,
6962           0.2265575594114e-08, 0.3414949866857e+01, 0.2235935264888e+00,
6963           0.2464381430585e-08, 0.4599122275378e+01, 0.2091065926078e+00,
6964           0.2433408527044e-08, 0.2830751145445e+00, 0.2174915669488e+00,
6965           0.2443605509076e-08, 0.4212046432538e+01, 0.1739420156204e+00,
6966           0.2319779262465e-08, 0.9881978408630e+00, 0.7530171478090e-01,
6967           0.2284622835465e-08, 0.5565347331588e+00, 0.7426161660010e-01,
6968           0.2467268750783e-08, 0.5655708150766e+00, 0.2526561439362e+00,
6969           0.2808513492782e-08, 0.1418405053408e+01, 0.5636314030725e+00,
6970 
6971           0.2329528932532e-08, 0.4069557545675e+01, 0.1056200952181e+01,
6972           0.9698639532817e-09, 0.1074134313634e+01, 0.7826370942180e+02 };
6973 
6974     /* SSB-to-Sun, T^0, Y */
6975       static final double s0y[] = {
6976           0.4955392320126e-02, 0.2170467313679e+01, 0.5296909721118e+00,
6977           0.2722325167392e-02, 0.2444433682196e+01, 0.2132990797783e+00,
6978           0.1546579925346e-02, 0.5992779281546e+00, 0.3813291813120e-01,
6979           0.8363140252966e-03, 0.7687356310801e+00, 0.7478166569050e-01,
6980           0.3385792683603e-03, 0.0000000000000e+00, 0.0000000000000e+00,
6981           0.1201192221613e-03, 0.2520035601514e+01, 0.1059381944224e+01,
6982           0.7587125720554e-04, 0.1669954006449e+01, 0.4265981595566e+00,
6983           0.1964155361250e-04, 0.5707743963343e+01, 0.2061856251104e+00,
6984           0.1891900364909e-04, 0.2320960679937e+01, 0.2204125344462e+00,
6985           0.1937373433356e-04, 0.3226940689555e+01, 0.1495633313810e+00,
6986 
6987           0.1437139941351e-04, 0.2301626908096e+01, 0.5225775174439e+00,
6988           0.1406267683099e-04, 0.5188579265542e+01, 0.5368044267797e+00,
6989           0.1178703080346e-04, 0.5489483248476e+01, 0.7626583626240e-01,
6990           0.8079835186041e-05, 0.1683751835264e+01, 0.3664874755930e-01,
6991           0.7623253594652e-05, 0.2656400462961e+01, 0.3961708870310e-01,
6992           0.6248667483971e-05, 0.4992775362055e+01, 0.7329749511860e-01,
6993           0.4366353695038e-05, 0.2869706279678e+01, 0.1589072916335e+01,
6994           0.3829101568895e-05, 0.3572131359950e+01, 0.7113454667900e-02,
6995           0.3175733773908e-05, 0.4535372530045e+01, 0.4194847048887e+00,
6996           0.3092437902159e-05, 0.9230153317909e+00, 0.6398972393349e+00,
6997 
6998           0.2874168812154e-05, 0.3363143761101e+01, 0.1102062672231e+00,
6999           0.3040119321826e-05, 0.3324250895675e+01, 0.6283075850446e+01,
7000           0.2699723308006e-05, 0.2917882441928e+00, 0.1030928125552e+00,
7001           0.2134832683534e-05, 0.4220997202487e+01, 0.3163918923335e+00,
7002           0.1770412139433e-05, 0.4747318496462e+01, 0.1021328554739e+02,
7003           0.1377264209373e-05, 0.4305058462401e+00, 0.1484170571900e-02,
7004           0.1127814538960e-05, 0.8538177240740e+00, 0.6327837846670e+00,
7005           0.1055608090130e-05, 0.1551800742580e+01, 0.4337116142245e+00,
7006           0.9802673861420e-06, 0.1459646735377e+01, 0.1052268489556e+01,
7007           0.1090329461951e-05, 0.1587351228711e+01, 0.1162474756779e+01,
7008 
7009           0.6959590025090e-06, 0.5534442628766e+01, 0.1066495398892e+01,
7010           0.5664914529542e-06, 0.6030673003297e+01, 0.9491756770005e+00,
7011           0.6607787763599e-06, 0.4989507233927e+01, 0.8460828644453e+00,
7012           0.6269725742838e-06, 0.4222951804572e+01, 0.1480791608091e+00,
7013           0.6301889697863e-06, 0.5444316669126e+01, 0.2243449970715e+00,
7014           0.4891042662861e-06, 0.1490552839784e+01, 0.3340612434717e+01,
7015           0.3457083123290e-06, 0.3030475486049e+01, 0.3516457698740e-01,
7016           0.3032559967314e-06, 0.2652038793632e+01, 0.1104591729320e-01,
7017           0.2841133988903e-06, 0.1276744786829e+01, 0.4110125927500e-01,
7018           0.2855564444432e-06, 0.2143368674733e+01, 0.1510475019529e+00,
7019 
7020           0.2765157135038e-06, 0.5444186109077e+01, 0.6373574839730e-01,
7021           0.2382312465034e-06, 0.2190521137593e+01, 0.2275259891141e+00,
7022           0.2808060365077e-06, 0.5735195064841e+01, 0.2535050500000e-01,
7023           0.2332175234405e-06, 0.9481985524859e-01, 0.7181332454670e-01,
7024           0.2322488199659e-06, 0.5180499361533e+01, 0.8582758298370e-01,
7025           0.1881850258423e-06, 0.3219788273885e+01, 0.2118763888447e+01,
7026           0.2196111392808e-06, 0.2366941159761e+01, 0.2968341143800e-02,
7027           0.2183810335519e-06, 0.4825445110915e+01, 0.7775000683430e-01,
7028           0.2002733093326e-06, 0.2457148995307e+01, 0.2093666171530e+00,
7029           0.1967111767229e-06, 0.5586291545459e+01, 0.2172315424036e+00,
7030 
7031           0.1568473250543e-06, 0.3708003123320e+01, 0.7429900518901e+00,
7032           0.1852528314300e-06, 0.4310638151560e+01, 0.2022531624851e+00,
7033           0.1832111226447e-06, 0.1494665322656e+01, 0.3235053470014e+00,
7034           0.1746805502310e-06, 0.1451378500784e+01, 0.1385174140878e+00,
7035           0.1555730966650e-06, 0.1068040418198e+01, 0.7358765972222e+00,
7036           0.1554883462559e-06, 0.2442579035461e+01, 0.5154640627760e+00,
7037           0.1638380568746e-06, 0.2597913420625e+00, 0.8531963191132e+00,
7038           0.1159938593640e-06, 0.5834512021280e+01, 0.1990721704425e+00,
7039           0.1083427965695e-06, 0.5054033177950e+01, 0.5439178814476e+00,
7040           0.1156480369431e-06, 0.5325677432457e+01, 0.5257585094865e+00,
7041 
7042           0.1141308860095e-06, 0.2153403923857e+01, 0.5336234347371e+00,
7043           0.7913146470946e-07, 0.8642846847027e+00, 0.1478866649112e+01,
7044           0.7439752463733e-07, 0.1970628496213e+01, 0.2164800718209e+00,
7045           0.7280277104079e-07, 0.6073307250609e+01, 0.2101180877357e+00,
7046           0.8319567719136e-07, 0.1954371928334e+01, 0.1692165728891e+01,
7047           0.7137705549290e-07, 0.8904989440909e+00, 0.4155522422634e+00,
7048           0.6900825396225e-07, 0.2825717714977e+01, 0.1173197218910e+00,
7049           0.7245757216635e-07, 0.2481677513331e+01, 0.1265567569334e+01,
7050           0.6961165696255e-07, 0.1292955312978e+01, 0.9562891316684e+00,
7051           0.7571804456890e-07, 0.3427517575069e+01, 0.1422690933580e-01,
7052 
7053           0.6605425721904e-07, 0.8052192701492e+00, 0.6470106940028e+00,
7054           0.7375477357248e-07, 0.1705076390088e+01, 0.1581959461667e+01,
7055           0.7041664951470e-07, 0.4848356967891e+00, 0.9597935788730e-01,
7056           0.6322199535763e-07, 0.3878069473909e+01, 0.7084920306520e-01,
7057           0.5244380279191e-07, 0.2645560544125e+01, 0.5265099800692e+00,
7058           0.5143125704988e-07, 0.4834486101370e+01, 0.5328719641544e+00,
7059           0.5871866319373e-07, 0.7981472548900e+00, 0.7871412831580e-01,
7060           0.6300822573871e-07, 0.5979398788281e+01, 0.2608790314060e+02,
7061           0.6062154271548e-07, 0.4108655402756e+01, 0.1114304132498e+00,
7062           0.4361912339976e-07, 0.5322624319280e+01, 0.1375773836557e+01,
7063 
7064           0.4417005920067e-07, 0.6240817359284e+01, 0.2770348281756e+00,
7065           0.4686806749936e-07, 0.3214977301156e+01, 0.1143987543936e+00,
7066           0.3758892132305e-07, 0.5879809634765e+01, 0.1596186371003e+01,
7067           0.5151351332319e-07, 0.2893377688007e+00, 0.2228608264996e+00,
7068           0.4554683578572e-07, 0.5475427144122e+01, 0.1465949902372e+00,
7069           0.3442381385338e-07, 0.5992034796640e+01, 0.5070101000000e-01,
7070           0.2831093954933e-07, 0.5367350273914e+01, 0.3092784376656e+00,
7071           0.3756267090084e-07, 0.5758171285420e+01, 0.4903339079539e+00,
7072           0.2816374679892e-07, 0.1863718700923e+01, 0.2991266627620e+00,
7073           0.3419307025569e-07, 0.9524347534130e+00, 0.3518164938661e+00,
7074 
7075           0.2904250494239e-07, 0.5304471615602e+01, 0.1099462426779e+00,
7076           0.2471734511206e-07, 0.1297069793530e+01, 0.6256703299991e+00,
7077           0.2539620831872e-07, 0.3281126083375e+01, 0.1256615170089e+02,
7078           0.2281017868007e-07, 0.1829122133165e+01, 0.6681224869435e+01,
7079           0.2275319473335e-07, 0.5797198160181e+01, 0.3932462625300e-02,
7080           0.2547755368442e-07, 0.4752697708330e+01, 0.1169588211447e+01,
7081           0.2285979669317e-07, 0.1223205292886e+01, 0.1045155034888e+01,
7082           0.1913386560994e-07, 0.1757532993389e+01, 0.1155361302111e+01,
7083           0.1809020525147e-07, 0.4246116108791e+01, 0.3368040641550e-01,
7084           0.1649213300201e-07, 0.1445162890627e+01, 0.4408250688924e+00,
7085 
7086           0.1834972793932e-07, 0.1126917567225e+01, 0.4452511715700e-02,
7087           0.1439550648138e-07, 0.6160756834764e+01, 0.9420622223326e+00,
7088           0.1487645457041e-07, 0.4358761931792e+01, 0.4123712502208e+00,
7089           0.1731729516660e-07, 0.6134456753344e+01, 0.2108507877249e+00,
7090           0.1717747163567e-07, 0.1898186084455e+01, 0.2157473718317e+00,
7091           0.1418190430374e-07, 0.4180286741266e+01, 0.6521991896920e-01,
7092           0.1404844134873e-07, 0.7654053565412e-01, 0.4258542984690e-01,
7093           0.1409842846538e-07, 0.4418612420312e+01, 0.2258291676434e+00,
7094           0.1090948346291e-07, 0.1260615686131e+01, 0.4226656969313e+00,
7095           0.1357577323612e-07, 0.3558248818690e+01, 0.7923417740620e-01,
7096 
7097           0.1018154061960e-07, 0.5676087241256e+01, 0.1456308687557e+00,
7098           0.1412073972109e-07, 0.8394392632422e+00, 0.1525316725248e+00,
7099           0.1030938326496e-07, 0.1653593274064e+01, 0.1795258541446e+01,
7100           0.1180081567104e-07, 0.1285802592036e+01, 0.7032915397480e-01,
7101           0.9708510575650e-08, 0.7631889488106e+00, 0.8434341241180e-01,
7102           0.9637689663447e-08, 0.4630642649176e+01, 0.1272681024002e+01,
7103           0.1068910429389e-07, 0.5294934032165e+01, 0.2123349582968e+00,
7104           0.1063716179336e-07, 0.2736266800832e+01, 0.2142632012598e+00,
7105           0.1234858713814e-07, 0.1302891146570e+01, 0.1847279083684e+00,
7106           0.8912631189738e-08, 0.3570415993621e+01, 0.2648454860559e+01,
7107 
7108           0.1036378285534e-07, 0.4236693440949e+01, 0.1370332435159e+00,
7109           0.9667798501561e-08, 0.2960768892398e+01, 0.4376440768498e+00,
7110           0.8108314201902e-08, 0.6987781646841e+00, 0.2880807454688e+00,
7111           0.7648364324628e-08, 0.2499017863863e+01, 0.2037373330570e+00,
7112           0.7286136828406e-08, 0.3787426951665e+01, 0.1129145838217e+00,
7113           0.9448237743913e-08, 0.2694354332983e+01, 0.5272426800584e+00,
7114           0.9374276106428e-08, 0.4787121277064e+01, 0.5321392641652e+00,
7115           0.7100226287462e-08, 0.3530238792101e+00, 0.6288513220417e+00,
7116           0.9253056659571e-08, 0.1399478925664e+01, 0.1606092486742e+00,
7117           0.6636432145504e-08, 0.3479575438447e+01, 0.1368660381889e+01,
7118 
7119           0.6469975312932e-08, 0.1383669964800e+01, 0.2008557621224e+01,
7120           0.7335849729765e-08, 0.1243698166898e+01, 0.9561746721300e-02,
7121           0.8743421205855e-08, 0.3776164289301e+01, 0.3801276407308e+00,
7122           0.5993635744494e-08, 0.5627122113596e+01, 0.2042657109477e+02,
7123           0.5981008479693e-08, 0.1674336636752e+01, 0.2111650433779e+01,
7124           0.6188535145838e-08, 0.5214925208672e+01, 0.4305306221819e+00,
7125           0.6596074017566e-08, 0.2907653268124e+01, 0.1063314406849e+01,
7126           0.6630815126226e-08, 0.2127643669658e+01, 0.8389694097774e+00,
7127           0.6156772830040e-08, 0.5082160803295e+01, 0.4234171675140e+00,
7128           0.6446960563014e-08, 0.1872100916905e+01, 0.5287268506303e+00,
7129 
7130           0.6429324424668e-08, 0.5610276103577e+01, 0.5306550935933e+00,
7131           0.6302232396465e-08, 0.1592152049607e+01, 0.1253008786510e-01,
7132           0.6399244436159e-08, 0.2746214421532e+01, 0.5217580628120e+02,
7133           0.5474965172558e-08, 0.2317666374383e+01, 0.2221856701002e+01,
7134           0.5339293190692e-08, 0.1084724961156e+01, 0.7466759693650e-01,
7135           0.5334733683389e-08, 0.3594106067745e+01, 0.7489573444450e-01,
7136           0.5392665782110e-08, 0.5630254365606e+01, 0.1055449481598e+01,
7137           0.6682075673789e-08, 0.1518480041732e+01, 0.2213766559277e+00,
7138           0.5079130495960e-08, 0.2739765115711e+01, 0.2132517061319e+00,
7139           0.5077759793261e-08, 0.5290711290094e+01, 0.2133464534247e+00,
7140 
7141           0.4832037368310e-08, 0.1404473217200e+01, 0.7160067364790e-01,
7142           0.6463279674802e-08, 0.6038381695210e+01, 0.2209183458640e-01,
7143           0.6240592771560e-08, 0.1290170653666e+01, 0.3306188016693e+00,
7144           0.4672013521493e-08, 0.3261895939677e+01, 0.7796265773310e-01,
7145           0.6500650750348e-08, 0.1154522312095e+01, 0.3884652414254e+00,
7146           0.6344161389053e-08, 0.6206111545062e+01, 0.7605151500000e-01,
7147           0.4682518370646e-08, 0.5409118796685e+01, 0.1073608853559e+01,
7148           0.5329460015591e-08, 0.1202985784864e+01, 0.7287631425543e+00,
7149           0.5701588675898e-08, 0.4098715257064e+01, 0.8731175355560e-01,
7150           0.6030690867211e-08, 0.4132033218460e+00, 0.9846002785331e+00,
7151 
7152           0.4336256312655e-08, 0.1211415991827e+01, 0.4297791515992e+00,
7153           0.4688498808975e-08, 0.3765479072409e+01, 0.2127790306879e+00,
7154           0.4675578609335e-08, 0.4265540037226e+01, 0.2138191288687e+00,
7155           0.4225578112158e-08, 0.5237566010676e+01, 0.3407705765729e+00,
7156           0.5139422230028e-08, 0.1507173079513e+01, 0.7233337363710e-01,
7157           0.4619995093571e-08, 0.9023957449848e-01, 0.8603097737811e+00,
7158           0.4494776255461e-08, 0.5414930552139e+00, 0.7381754420900e-01,
7159           0.4274026276788e-08, 0.4145735303659e+01, 0.7574578717200e-01,
7160           0.5018141789353e-08, 0.3344408829055e+01, 0.3180992042600e-02,
7161           0.4866163952181e-08, 0.3348534657607e+01, 0.7722995774390e-01,
7162 
7163           0.4111986020501e-08, 0.4198823597220e+00, 0.1451108196653e+00,
7164           0.3356142784950e-08, 0.5609144747180e+01, 0.1274714967946e+00,
7165           0.4070575554551e-08, 0.7028411059224e+00, 0.3503323232942e+00,
7166           0.3257451857278e-08, 0.5624697983086e+01, 0.5296435984654e+00,
7167           0.3256973703026e-08, 0.1857842076707e+01, 0.5297383457582e+00,
7168           0.3830771508640e-08, 0.4562887279931e+01, 0.9098186128426e+00,
7169           0.3725024005962e-08, 0.2358058692652e+00, 0.1084620721060e+00,
7170           0.3136763921756e-08, 0.2049731526845e+01, 0.2346394437820e+00,
7171           0.3795147256194e-08, 0.2432356296933e+00, 0.1862120789403e+00,
7172           0.2877342229911e-08, 0.5631101279387e+01, 0.1905464808669e+01,
7173 
7174           0.3076931798805e-08, 0.1117615737392e+01, 0.3628624111593e+00,
7175           0.2734765945273e-08, 0.5899826516955e+01, 0.2131850110243e+00,
7176           0.2733405296885e-08, 0.2130562964070e+01, 0.2134131485323e+00,
7177           0.2898552353410e-08, 0.3462387048225e+00, 0.5291709230214e+00,
7178           0.2893736103681e-08, 0.8534352781543e+00, 0.5302110212022e+00,
7179           0.3095717734137e-08, 0.2875061429041e+01, 0.2976424921901e+00,
7180           0.2636190425832e-08, 0.2242512846659e+01, 0.1485980103780e+01,
7181           0.3645512095537e-08, 0.1354016903958e+01, 0.6044726378023e+00,
7182           0.2808173547723e-08, 0.6705114365631e-01, 0.6225157782540e-01,
7183           0.2625012866888e-08, 0.4775705748482e+01, 0.5268983110410e-01,
7184 
7185           0.2572233995651e-08, 0.2638924216139e+01, 0.1258454114666e+01,
7186           0.2604238824792e-08, 0.4826358927373e+01, 0.2103781122809e+00,
7187           0.2596886385239e-08, 0.3200388483118e+01, 0.2162200472757e+00,
7188           0.3228057304264e-08, 0.5384848409563e+01, 0.2007689919132e+00,
7189           0.2481601798252e-08, 0.5173373487744e+01, 0.1062562936266e+01,
7190           0.2745977498864e-08, 0.6250966149853e+01, 0.5651155736444e+00,
7191           0.2669878833811e-08, 0.4906001352499e+01, 0.1400015846597e+00,
7192           0.3203986611711e-08, 0.5034333010005e+01, 0.7036329877322e+00,
7193           0.3354961227212e-08, 0.6108262423137e+01, 0.4549093064213e+00,
7194           0.2400407324558e-08, 0.2135399294955e+01, 0.2125476091956e+00,
7195 
7196           0.2379905859802e-08, 0.5893721933961e+01, 0.2140505503610e+00,
7197           0.2550844302187e-08, 0.3331940762063e+01, 0.1534957940063e+00,
7198           0.2268824211001e-08, 0.1843418461035e+01, 0.2235935264888e+00,
7199           0.2464700891204e-08, 0.3029548547230e+01, 0.2091065926078e+00,
7200           0.2436814726024e-08, 0.4994717970364e+01, 0.2174915669488e+00,
7201           0.2443623894745e-08, 0.2645102591375e+01, 0.1739420156204e+00,
7202           0.2318701783838e-08, 0.5700547397897e+01, 0.7530171478090e-01,
7203           0.2284448700256e-08, 0.5268898905872e+01, 0.7426161660010e-01,
7204           0.2468848123510e-08, 0.5276280575078e+01, 0.2526561439362e+00,
7205           0.2814052350303e-08, 0.6130168623475e+01, 0.5636314030725e+00,
7206 
7207           0.2243662755220e-08, 0.6631692457995e+00, 0.8886590321940e-01,
7208           0.2330795855941e-08, 0.2499435487702e+01, 0.1056200952181e+01,
7209           0.9757679038404e-09, 0.5796846023126e+01, 0.7826370942180e+02 };
7210 
7211     /* SSB-to-Sun, T^0, Z */
7212       static  final double s0z[] = {
7213           0.1181255122986e-03, 0.4607918989164e+00, 0.2132990797783e+00,
7214           0.1127777651095e-03, 0.4169146331296e+00, 0.5296909721118e+00,
7215           0.4777754401806e-04, 0.4582657007130e+01, 0.3813291813120e-01,
7216           0.1129354285772e-04, 0.5758735142480e+01, 0.7478166569050e-01,
7217          -0.1149543637123e-04, 0.0000000000000e+00, 0.0000000000000e+00,
7218           0.3298730512306e-05, 0.5978801994625e+01, 0.4265981595566e+00,
7219           0.2733376706079e-05, 0.7665413691040e+00, 0.1059381944224e+01,
7220           0.9426389657270e-06, 0.3710201265838e+01, 0.2061856251104e+00,
7221           0.8187517749552e-06, 0.3390675605802e+00, 0.2204125344462e+00,
7222           0.4080447871819e-06, 0.4552296640088e+00, 0.5225775174439e+00,
7223 
7224           0.3169973017028e-06, 0.3445455899321e+01, 0.5368044267797e+00,
7225           0.2438098615549e-06, 0.5664675150648e+01, 0.3664874755930e-01,
7226           0.2601897517235e-06, 0.1931894095697e+01, 0.1495633313810e+00,
7227           0.2314558080079e-06, 0.3666319115574e+00, 0.3961708870310e-01,
7228           0.1962549548002e-06, 0.3167411699020e+01, 0.7626583626240e-01,
7229           0.2180518287925e-06, 0.1544420746580e+01, 0.7113454667900e-02,
7230           0.1451382442868e-06, 0.1583756740070e+01, 0.1102062672231e+00,
7231           0.1358439007389e-06, 0.5239941758280e+01, 0.6398972393349e+00,
7232           0.1050585898028e-06, 0.2266958352859e+01, 0.3163918923335e+00,
7233           0.1050029870186e-06, 0.2711495250354e+01, 0.4194847048887e+00,
7234 
7235           0.9934920679800e-07, 0.1116208151396e+01, 0.1589072916335e+01,
7236           0.1048395331560e-06, 0.3408619600206e+01, 0.1021328554739e+02,
7237           0.8370147196668e-07, 0.3810459401087e+01, 0.2535050500000e-01,
7238           0.7989856510998e-07, 0.3769910473647e+01, 0.7329749511860e-01,
7239           0.5441221655233e-07, 0.2416994903374e+01, 0.1030928125552e+00,
7240           0.4610812906784e-07, 0.5858503336994e+01, 0.4337116142245e+00,
7241           0.3923022803444e-07, 0.3354170010125e+00, 0.1484170571900e-02,
7242           0.2610725582128e-07, 0.5410600646324e+01, 0.6327837846670e+00,
7243           0.2455279767721e-07, 0.6120216681403e+01, 0.1162474756779e+01,
7244           0.2375530706525e-07, 0.6055443426143e+01, 0.1052268489556e+01,
7245 
7246           0.1782967577553e-07, 0.3146108708004e+01, 0.8460828644453e+00,
7247           0.1581687095238e-07, 0.6255496089819e+00, 0.3340612434717e+01,
7248           0.1594657672461e-07, 0.3782604300261e+01, 0.1066495398892e+01,
7249           0.1563448615040e-07, 0.1997775733196e+01, 0.2022531624851e+00,
7250           0.1463624258525e-07, 0.1736316792088e+00, 0.3516457698740e-01,
7251           0.1331585056673e-07, 0.4331941830747e+01, 0.9491756770005e+00,
7252           0.1130634557637e-07, 0.6152017751825e+01, 0.2968341143800e-02,
7253           0.1028949607145e-07, 0.2101792614637e+00, 0.2275259891141e+00,
7254           0.1024074971618e-07, 0.4071833211074e+01, 0.5070101000000e-01,
7255           0.8826956060303e-08, 0.4861633688145e+00, 0.2093666171530e+00,
7256 
7257           0.8572230171541e-08, 0.5268190724302e+01, 0.4110125927500e-01,
7258           0.7649332643544e-08, 0.5134543417106e+01, 0.2608790314060e+02,
7259           0.8581673291033e-08, 0.2920218146681e+01, 0.1480791608091e+00,
7260           0.8430589300938e-08, 0.3604576619108e+01, 0.2172315424036e+00,
7261           0.7776165501012e-08, 0.3772942249792e+01, 0.6373574839730e-01,
7262           0.8311070234408e-08, 0.6200412329888e+01, 0.3235053470014e+00,
7263           0.6927365212582e-08, 0.4543353113437e+01, 0.8531963191132e+00,
7264           0.6791574208598e-08, 0.2882188406238e+01, 0.7181332454670e-01,
7265           0.5593100811839e-08, 0.1776646892780e+01, 0.7429900518901e+00,
7266           0.4553381853021e-08, 0.3949617611240e+01, 0.7775000683430e-01,
7267 
7268           0.5758000450068e-08, 0.3859251775075e+01, 0.1990721704425e+00,
7269           0.4281283457133e-08, 0.1466294631206e+01, 0.2118763888447e+01,
7270           0.4206935661097e-08, 0.5421776011706e+01, 0.1104591729320e-01,
7271           0.4213751641837e-08, 0.3412048993322e+01, 0.2243449970715e+00,
7272           0.5310506239878e-08, 0.5421641370995e+00, 0.5154640627760e+00,
7273           0.3827450341320e-08, 0.8887314524995e+00, 0.1510475019529e+00,
7274           0.4292435241187e-08, 0.1405043757194e+01, 0.1422690933580e-01,
7275           0.3189780702289e-08, 0.1060049293445e+01, 0.1173197218910e+00,
7276           0.3226611928069e-08, 0.6270858897442e+01, 0.2164800718209e+00,
7277           0.2893897608830e-08, 0.5117563223301e+01, 0.6470106940028e+00,
7278 
7279           0.3239852024578e-08, 0.4079092237983e+01, 0.2101180877357e+00,
7280           0.2956892222200e-08, 0.1594917021704e+01, 0.3092784376656e+00,
7281           0.2980177912437e-08, 0.5258787667564e+01, 0.4155522422634e+00,
7282           0.3163725690776e-08, 0.3854589225479e+01, 0.8582758298370e-01,
7283           0.2662262399118e-08, 0.3561326430187e+01, 0.5257585094865e+00,
7284           0.2766689135729e-08, 0.3180732086830e+00, 0.1385174140878e+00,
7285           0.2411600278464e-08, 0.3324798335058e+01, 0.5439178814476e+00,
7286           0.2483527695131e-08, 0.4169069291947e+00, 0.5336234347371e+00,
7287           0.7788777276590e-09, 0.1900569908215e+01, 0.5217580628120e+02 };
7288 
7289     /* SSB-to-Sun, T^1, X */
7290       static  final double s1x[] = {
7291          -0.1296310361520e-07, 0.0000000000000e+00, 0.0000000000000e+00,
7292           0.8975769009438e-08, 0.1128891609250e+01, 0.4265981595566e+00,
7293           0.7771113441307e-08, 0.2706039877077e+01, 0.2061856251104e+00,
7294           0.7538303866642e-08, 0.2191281289498e+01, 0.2204125344462e+00,
7295           0.6061384579336e-08, 0.3248167319958e+01, 0.1059381944224e+01,
7296           0.5726994235594e-08, 0.5569981398610e+01, 0.5225775174439e+00,
7297           0.5616492836424e-08, 0.5057386614909e+01, 0.5368044267797e+00,
7298           0.1010881584769e-08, 0.3473577116095e+01, 0.7113454667900e-02,
7299           0.7259606157626e-09, 0.3651858593665e+00, 0.6398972393349e+00,
7300           0.8755095026935e-09, 0.1662835408338e+01, 0.4194847048887e+00,
7301 
7302           0.5370491182812e-09, 0.1327673878077e+01, 0.4337116142245e+00,
7303           0.5743773887665e-09, 0.4250200846687e+01, 0.2132990797783e+00,
7304           0.4408103140300e-09, 0.3598752574277e+01, 0.1589072916335e+01,
7305           0.3101892374445e-09, 0.4887822983319e+01, 0.1052268489556e+01,
7306           0.3209453713578e-09, 0.9702272295114e+00, 0.5296909721118e+00,
7307           0.3017228286064e-09, 0.5484462275949e+01, 0.1066495398892e+01,
7308           0.3200700038601e-09, 0.2846613338643e+01, 0.1495633313810e+00,
7309           0.2137637279911e-09, 0.5692163292729e+00, 0.3163918923335e+00,
7310           0.1899686386727e-09, 0.2061077157189e+01, 0.2275259891141e+00,
7311           0.1401994545308e-09, 0.4177771136967e+01, 0.1102062672231e+00,
7312 
7313           0.1578057810499e-09, 0.5782460597335e+01, 0.7626583626240e-01,
7314           0.1237713253351e-09, 0.5705900866881e+01, 0.5154640627760e+00,
7315           0.1313076837395e-09, 0.5163438179576e+01, 0.3664874755930e-01,
7316           0.1184963304860e-09, 0.3054804427242e+01, 0.6327837846670e+00,
7317           0.1238130878565e-09, 0.2317292575962e+01, 0.3961708870310e-01,
7318           0.1015959527736e-09, 0.2194643645526e+01, 0.7329749511860e-01,
7319           0.9017954423714e-10, 0.2868603545435e+01, 0.1990721704425e+00,
7320           0.8668024955603e-10, 0.4923849675082e+01, 0.5439178814476e+00,
7321           0.7756083930103e-10, 0.3014334135200e+01, 0.9491756770005e+00,
7322           0.7536503401741e-10, 0.2704886279769e+01, 0.1030928125552e+00,
7323 
7324           0.5483308679332e-10, 0.6010983673799e+01, 0.8531963191132e+00,
7325           0.5184339620428e-10, 0.1952704573291e+01, 0.2093666171530e+00,
7326           0.5108658712030e-10, 0.2958575786649e+01, 0.2172315424036e+00,
7327           0.5019424524650e-10, 0.1736317621318e+01, 0.2164800718209e+00,
7328           0.4909312625978e-10, 0.3167216416257e+01, 0.2101180877357e+00,
7329           0.4456638901107e-10, 0.7697579923471e+00, 0.3235053470014e+00,
7330           0.4227030350925e-10, 0.3490910137928e+01, 0.6373574839730e-01,
7331           0.4095456040093e-10, 0.5178888984491e+00, 0.6470106940028e+00,
7332           0.4990537041422e-10, 0.3323887668974e+01, 0.1422690933580e-01,
7333           0.4321170010845e-10, 0.4288484987118e+01, 0.7358765972222e+00,
7334 
7335           0.3544072091802e-10, 0.6021051579251e+01, 0.5265099800692e+00,
7336           0.3480198638687e-10, 0.4600027054714e+01, 0.5328719641544e+00,
7337           0.3440287244435e-10, 0.4349525970742e+01, 0.8582758298370e-01,
7338           0.3330628322713e-10, 0.2347391505082e+01, 0.1104591729320e-01,
7339           0.2973060707184e-10, 0.4789409286400e+01, 0.5257585094865e+00,
7340           0.2932606766089e-10, 0.5831693799927e+01, 0.5336234347371e+00,
7341           0.2876972310953e-10, 0.2692638514771e+01, 0.1173197218910e+00,
7342           0.2827488278556e-10, 0.2056052487960e+01, 0.2022531624851e+00,
7343           0.2515028239756e-10, 0.7411863262449e+00, 0.9597935788730e-01,
7344           0.2853033744415e-10, 0.3948481024894e+01, 0.2118763888447e+01 };
7345 
7346     /* SSB-to-Sun, T^1, Y */
7347       static  final double s1y[] = {
7348           0.8989047573576e-08, 0.5840593672122e+01, 0.4265981595566e+00,
7349           0.7815938401048e-08, 0.1129664707133e+01, 0.2061856251104e+00,
7350           0.7550926713280e-08, 0.6196589104845e+00, 0.2204125344462e+00,
7351           0.6056556925895e-08, 0.1677494667846e+01, 0.1059381944224e+01,
7352           0.5734142698204e-08, 0.4000920852962e+01, 0.5225775174439e+00,
7353           0.5614341822459e-08, 0.3486722577328e+01, 0.5368044267797e+00,
7354           0.1028678147656e-08, 0.1877141024787e+01, 0.7113454667900e-02,
7355           0.7270792075266e-09, 0.5077167301739e+01, 0.6398972393349e+00,
7356           0.8734141726040e-09, 0.9069550282609e-01, 0.4194847048887e+00,
7357           0.5377371402113e-09, 0.6039381844671e+01, 0.4337116142245e+00,
7358 
7359           0.4729719431571e-09, 0.2153086311760e+01, 0.2132990797783e+00,
7360           0.4458052820973e-09, 0.5059830025565e+01, 0.5296909721118e+00,
7361           0.4406855467908e-09, 0.2027971692630e+01, 0.1589072916335e+01,
7362           0.3101659310977e-09, 0.3317677981860e+01, 0.1052268489556e+01,
7363           0.3016749232545e-09, 0.3913703482532e+01, 0.1066495398892e+01,
7364           0.3198541352656e-09, 0.1275513098525e+01, 0.1495633313810e+00,
7365           0.2142065389871e-09, 0.5301351614597e+01, 0.3163918923335e+00,
7366           0.1902615247592e-09, 0.4894943352736e+00, 0.2275259891141e+00,
7367           0.1613410990871e-09, 0.2449891130437e+01, 0.1102062672231e+00,
7368           0.1576992165097e-09, 0.4211421447633e+01, 0.7626583626240e-01,
7369 
7370           0.1241637259894e-09, 0.4140803368133e+01, 0.5154640627760e+00,
7371           0.1313974830355e-09, 0.3591920305503e+01, 0.3664874755930e-01,
7372           0.1181697118258e-09, 0.1506314382788e+01, 0.6327837846670e+00,
7373           0.1238239742779e-09, 0.7461405378404e+00, 0.3961708870310e-01,
7374           0.1010107068241e-09, 0.6271010795475e+00, 0.7329749511860e-01,
7375           0.9226316616509e-10, 0.1259158839583e+01, 0.1990721704425e+00,
7376           0.8664946419555e-10, 0.3353244696934e+01, 0.5439178814476e+00,
7377           0.7757230468978e-10, 0.1447677295196e+01, 0.9491756770005e+00,
7378           0.7693168628139e-10, 0.1120509896721e+01, 0.1030928125552e+00,
7379           0.5487897454612e-10, 0.4439380426795e+01, 0.8531963191132e+00,
7380 
7381           0.5196118677218e-10, 0.3788856619137e+00, 0.2093666171530e+00,
7382           0.5110853339935e-10, 0.1386879372016e+01, 0.2172315424036e+00,
7383           0.5027804534813e-10, 0.1647881805466e+00, 0.2164800718209e+00,
7384           0.4922485922674e-10, 0.1594315079862e+01, 0.2101180877357e+00,
7385           0.6155599524400e-10, 0.0000000000000e+00, 0.0000000000000e+00,
7386           0.4447147832161e-10, 0.5480720918976e+01, 0.3235053470014e+00,
7387           0.4144691276422e-10, 0.1931371033660e+01, 0.6373574839730e-01,
7388           0.4099950625452e-10, 0.5229611294335e+01, 0.6470106940028e+00,
7389           0.5060541682953e-10, 0.1731112486298e+01, 0.1422690933580e-01,
7390           0.4293615946300e-10, 0.2714571038925e+01, 0.7358765972222e+00,
7391 
7392           0.3545659845763e-10, 0.4451041444634e+01, 0.5265099800692e+00,
7393           0.3479112041196e-10, 0.3029385448081e+01, 0.5328719641544e+00,
7394           0.3438516493570e-10, 0.2778507143731e+01, 0.8582758298370e-01,
7395           0.3297341285033e-10, 0.7898709807584e+00, 0.1104591729320e-01,
7396           0.2972585818015e-10, 0.3218785316973e+01, 0.5257585094865e+00,
7397           0.2931707295017e-10, 0.4260731012098e+01, 0.5336234347371e+00,
7398           0.2897198149403e-10, 0.1120753978101e+01, 0.1173197218910e+00,
7399           0.2832293240878e-10, 0.4597682717827e+00, 0.2022531624851e+00,
7400           0.2864348326612e-10, 0.2169939928448e+01, 0.9597935788730e-01,
7401           0.2852714675471e-10, 0.2377659870578e+01, 0.2118763888447e+01 };
7402 
7403     /* SSB-to-Sun, T^1, Z */
7404       static final double s1z[] = {
7405           0.5444220475678e-08, 0.1803825509310e+01, 0.2132990797783e+00,
7406           0.3883412695596e-08, 0.4668616389392e+01, 0.5296909721118e+00,
7407           0.1334341434551e-08, 0.0000000000000e+00, 0.0000000000000e+00,
7408           0.3730001266883e-09, 0.5401405918943e+01, 0.2061856251104e+00,
7409           0.2894929197956e-09, 0.4932415609852e+01, 0.2204125344462e+00,
7410           0.2857950357701e-09, 0.3154625362131e+01, 0.7478166569050e-01,
7411           0.2499226432292e-09, 0.3657486128988e+01, 0.4265981595566e+00,
7412           0.1937705443593e-09, 0.5740434679002e+01, 0.1059381944224e+01,
7413           0.1374894396320e-09, 0.1712857366891e+01, 0.5368044267797e+00,
7414           0.1217248678408e-09, 0.2312090870932e+01, 0.5225775174439e+00,
7415 
7416           0.7961052740870e-10, 0.5283368554163e+01, 0.3813291813120e-01,
7417           0.4979225949689e-10, 0.4298290471860e+01, 0.4194847048887e+00,
7418           0.4388552286597e-10, 0.6145515047406e+01, 0.7113454667900e-02,
7419           0.2586835212560e-10, 0.3019448001809e+01, 0.6398972393349e+00 };
7420 
7421     /* SSB-to-Sun, T^2, X */
7422       static  final double s2x[] = {
7423           0.1603551636587e-11, 0.4404109410481e+01, 0.2061856251104e+00,
7424           0.1556935889384e-11, 0.4818040873603e+00, 0.2204125344462e+00,
7425           0.1182594414915e-11, 0.9935762734472e+00, 0.5225775174439e+00,
7426           0.1158794583180e-11, 0.3353180966450e+01, 0.5368044267797e+00,
7427           0.9597358943932e-12, 0.5567045358298e+01, 0.2132990797783e+00,
7428           0.6511516579605e-12, 0.5630872420788e+01, 0.4265981595566e+00,
7429           0.7419792747688e-12, 0.2156188581957e+01, 0.5296909721118e+00,
7430           0.3951972655848e-12, 0.1981022541805e+01, 0.1059381944224e+01,
7431           0.4478223877045e-12, 0.0000000000000e+00, 0.0000000000000e+00 };
7432 
7433     /* SSB-to-Sun, T^2, Y */
7434       static final double s2y[] = {
7435           0.1609114495091e-11, 0.2831096993481e+01, 0.2061856251104e+00,
7436           0.1560330784946e-11, 0.5193058213906e+01, 0.2204125344462e+00,
7437           0.1183535479202e-11, 0.5707003443890e+01, 0.5225775174439e+00,
7438           0.1158183066182e-11, 0.1782400404928e+01, 0.5368044267797e+00,
7439           0.1032868027407e-11, 0.4036925452011e+01, 0.2132990797783e+00,
7440           0.6540142847741e-12, 0.4058241056717e+01, 0.4265981595566e+00,
7441           0.7305236491596e-12, 0.6175401942957e+00, 0.5296909721118e+00,
7442          -0.5580725052968e-12, 0.0000000000000e+00, 0.0000000000000e+00,
7443           0.3946122651015e-12, 0.4108265279171e+00, 0.1059381944224e+01 };
7444 
7445     /* SSB-to-Sun, T^2, Z */
7446       static final double s2z[] = {
7447           0.3749920358054e-12, 0.3230285558668e+01, 0.2132990797783e+00,
7448           0.2735037220939e-12, 0.6154322683046e+01, 0.5296909721118e+00 };
7449         }
7450       
7451         /**
7452          *  Earth position and velocity, heliocentric and barycentric, with
7453          *  respect to the Barycentric Celestial Reference System.
7454          *
7455          *<p>This function is derived from the International Astronomical Union's
7456          *  SOFA (Standards Of Fundamental Astronomy) software collection.
7457          *
7458          *<p>Status:  support function.
7459          *
7460          *<!-- Given: -->
7461          *     @param date1 double         TDB date (Note 1)
7462          *     @param date2 double         TDB date (Note 1) 
7463          *
7464          *<!-- Returned: -->
7465          *     @param pvh           double[2][3]    <u>returned</u> heliocentric Earth position/velocity (au, au/d)
7466          *     @param pvb           double[2][3]    <u>returned</u> barycentric Earth position/velocity (au, au/d)
7467          *
7468          * <!-- Returned (function value): -->
7469          *  @return int           status: 0 = OK
7470          *                                       +1 = warning: date outside
7471          *                                            the range 1900-2100 AD
7472          *
7473          * <p>Notes:
7474          * <ol>
7475          *
7476          * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
7477          *     convenient way between the two arguments.  For example,
7478          *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
7479          *     others:
7480          *<pre>
7481          *            date1          date2
7482          *
7483          *         2450123.7           0.0       (JD method)
7484          *         2451545.0       -1421.3       (J2000 method)
7485          *         2400000.5       50123.2       (MJD method)
7486          *         2450123.5           0.2       (date &amp; time method)
7487          *</pre>
7488          *     The JD method is the most natural and convenient to use in cases
7489          *     where the loss of several decimal digits of resolution is
7490          *     acceptable.  The J2000 method is best matched to the way the
7491          *     argument is handled internally and will deliver the optimum
7492          *     resolution.  The MJD method and the date &amp; time methods are both
7493          *     good compromises between resolution and convenience.  However,
7494          *     the accuracy of the result is more likely to be limited by the
7495          *     algorithm itself than the way the date has been expressed.
7496          *
7497          *     n.b. TT can be used instead of TDB in most applications.
7498          *
7499          * <li> On return, the arrays pvh and pvb contain the following:
7500          *
7501          *        pvh[0][0]  x       }
7502          *        pvh[0][1]  y       } heliocentric position, au
7503          *        pvh[0][2]  z       }
7504          *
7505          *        pvh[1][0]  xdot    }
7506          *        pvh[1][1]  ydot    } heliocentric velocity, au/d
7507          *        pvh[1][2]  zdot    }
7508          *
7509          *        pvb[0][0]  x       }
7510          *        pvb[0][1]  y       } barycentric position, au
7511          *        pvb[0][2]  z       }
7512          *
7513          *        pvb[1][0]  xdot    }
7514          *        pvb[1][1]  ydot    } barycentric velocity, au/d
7515          *        pvb[1][2]  zdot    }
7516          *
7517          *     The vectors are with respect to the Barycentric Celestial
7518          *     Reference System.  The time unit is one day in TDB.
7519          *
7520          * <li> The function is a SIMPLIFIED SOLUTION from the planetary theory
7521          *     VSOP2000 (X. Moisson, P. Bretagnon, 2001, Celes. Mechanics &amp;
7522          *     Dyn. Astron., 80, 3/4, 205-213) and is an adaptation of original
7523          *     Fortran code supplied by P. Bretagnon (private comm., 2000).
7524          *
7525          * <li> Comparisons over the time span 1900-2100 with this simplified
7526          *     solution and the JPL DE405 ephemeris give the following results:
7527          *
7528          *                                RMS    max
7529          *           Heliocentric:
7530          *              position error    3.7   11.2   km
7531          *              velocity error    1.4    5.0   mm/s
7532          *
7533          *           Barycentric:
7534          *              position error    4.6   13.4   km
7535          *              velocity error    1.4    4.9   mm/s
7536          *
7537          *     Comparisons with the JPL DE406 ephemeris show that by 1800 and
7538          *     2200 the position errors are approximately double their 1900-2100
7539          *     size.  By 1500 and 2500 the deterioration is a factor of 10 and
7540          *     by 1000 and 3000 a factor of 60.  The velocity accuracy falls off
7541          *     at about half that rate.
7542          *
7543          * <li> It is permissible to use the same array for pvh and pvb, which
7544          *     will receive the barycentric values.
7545          *</ol>
7546          *@version 2008 November 18
7547          *
7548          *  @since Release 20101201
7549          *
7550          *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7551          */
7552          public static int jauEpv00(final double date1, final double date2,
7553                       double pvh[][], double pvb[][])
7554          {
7555          /*
7556          * Matrix elements for orienting the analytical model to DE405.
7557          *
7558          * The corresponding Euler angles are:
7559          *
7560          *                       d  '  "
7561          *   1st rotation    -  23 26 21.4091 about the x-axis  (obliquity)
7562          *   2nd rotation    +         0.0475 about the z-axis  (RA offset)
7563          *
7564          * These were obtained empirically, by comparisons with DE405 over
7565          * 1900-2100.
7566          */
7567             final double am12 =  0.000000211284,
7568                                 am13 = -0.000000091603,
7569                                 am21 = -0.000000230286,
7570                                 am22 =  0.917482137087,
7571                                 am23 = -0.397776982902,
7572                                 am32 =  0.397776982902,
7573                                 am33 =  0.917482137087;
7574             
7575       
7576         
7577         
7578     /* Pointers to coefficient arrays, in x,y,z sets */
7579        final double ce0[][] = { Ephemeris.e0x, Ephemeris.e0y, Ephemeris.e0z },
7580                            ce1[][] = { Ephemeris.e1x, Ephemeris.e1y, Ephemeris.e1z },
7581                            ce2[][] = { Ephemeris.e2x, Ephemeris.e2y, Ephemeris.e2z },
7582                            cs0[][] = { Ephemeris.s0x, Ephemeris.s0y, Ephemeris.s0z },
7583                            cs1[][] = { Ephemeris.s1x, Ephemeris.s1y, Ephemeris.s1z },
7584                            cs2[][] = { Ephemeris.s2x, Ephemeris.s2y, Ephemeris.s2z };
7585        /* Numbers of terms for each component of the model, in x,y,z sets */
7586        final int ne0[] = {Ephemeris.e0x.length/3,
7587                Ephemeris.e0y.length/3,
7588                Ephemeris.e0z.length/3 },
7589                         ne1[] = {Ephemeris.e1x.length/3,
7590                Ephemeris.e1y.length/3,
7591                Ephemeris.e1z.length/3 },
7592                         ne2[] = {Ephemeris.e2x.length/3,
7593                Ephemeris.e2y.length/3,
7594                Ephemeris.e2z.length/3 },
7595                         ns0[] = {Ephemeris.s0x.length/3,
7596                Ephemeris.s0y.length/3,
7597                Ephemeris.s0z.length/3 },
7598                         ns1[] = {Ephemeris.s1x.length/3,
7599                Ephemeris.s1y.length/3,
7600                Ephemeris.s1z.length/3 },
7601                         ns2[] = {Ephemeris.s2x.length/3,
7602                Ephemeris.s2y.length/3,
7603                Ephemeris.s2z.length/3 };
7604        int nterms;
7605 
7606     /* Miscellaneous */
7607        int jstat, i, j;
7608        double t, t2, xyz, xyzd, a, b, c, ct, p, cp,
7609               ph[] = new double[3], vh[] = new double[3], pb[] = new double[3], vb[] = new double[3], x, y, z;
7610 
7611     /*--------------------------------------------------------------------*/
7612 
7613     /* Time since reference epoch, Julian years. */
7614        t = ((date1 - DJ00) + date2) / DJY;
7615        t2 = t*t;
7616 
7617     /* Set status. */
7618        jstat = abs(t) <= 100.0 ? 0 : 1;
7619 
7620     /* X then Y then Z. */
7621        for (i = 0; i < 3; i++) {
7622 
7623        /* Initialize position and velocity component. */
7624           xyz = 0.0;
7625           xyzd = 0.0;
7626 
7627        /* ------------------------------------------------ */
7628        /* Obtain component of Sun to Earth ecliptic vector */
7629        /* ------------------------------------------------ */
7630 
7631        /* Sun to Earth, T^0 terms. */
7632           nterms = ne0[i];
7633           int idx;
7634           for (j = 0, idx=0; j < nterms; j++) {
7635              a = ce0[i][idx++];
7636              b = ce0[i][idx++];
7637              c = ce0[i][idx++];
7638              p = b + c*t;
7639              xyz  += a*cos(p);
7640              xyzd -= a*c*sin(p);
7641           }
7642 
7643        /* Sun to Earth, T^1 terms. */
7644           nterms = ne1[i];
7645           for (j = 0, idx= 0; j < nterms; j++) {
7646              a = ce1[i][idx++];
7647              b = ce1[i][idx++];
7648              c = ce1[i][idx++];
7649              ct = c*t;
7650              p = b + ct;
7651              cp = cos(p);
7652              xyz  += a*t*cp;
7653              xyzd += a*( cp - ct*sin(p) );
7654           }
7655 
7656        /* Sun to Earth, T^2 terms. */
7657           nterms = ne2[i];
7658           for (j = 0, idx = 0; j < nterms; j++) {
7659              a = ce2[i][idx++];
7660              b = ce2[i][idx++];
7661              c = ce2[i][idx++];
7662              ct = c*t;
7663              p = b + ct;
7664              cp = cos(p);
7665              xyz  += a*t2*cp;
7666              xyzd += a*t*( 2.0*cp - ct*sin(p) );
7667           }
7668 
7669        /* Heliocentric Earth position and velocity component. */
7670           ph[i] = xyz;
7671           vh[i] = xyzd / DJY;
7672 
7673        /* ------------------------------------------------ */
7674        /* Obtain component of SSB to Earth ecliptic vector */
7675        /* ------------------------------------------------ */
7676 
7677        /* SSB to Sun, T^0 terms. */
7678           nterms = ns0[i];
7679           for (j = 0, idx = 0; j < nterms; j++) {
7680              a = cs0[i][idx++];
7681              b = cs0[i][idx++];
7682              c = cs0[i][idx++];
7683              p = b + c*t;
7684              xyz  += a*cos(p);
7685              xyzd -= a*c*sin(p);
7686           }
7687 
7688        /* SSB to Sun, T^1 terms. */
7689           nterms = ns1[i];
7690           for (j = 0, idx = 0; j < nterms; j++) {
7691              a = cs1[i][idx++];
7692              b = cs1[i][idx++];
7693              c = cs1[i][idx++];
7694              ct = c*t;
7695              p = b + ct;
7696              cp = cos(p);
7697              xyz  += a*t*cp;
7698              xyzd += a*(cp - ct*sin(p));
7699           }
7700 
7701        /* SSB to Sun, T^2 terms. */
7702           nterms = ns2[i];
7703           for (j = 0, idx = 0; j < nterms; j++) {
7704              a = cs2[i][idx++];
7705              b = cs2[i][idx++];
7706              c = cs2[i][idx++];
7707              ct = c*t;
7708              p = b + ct;
7709              cp = cos(p);
7710              xyz  += a*t2*cp;
7711              xyzd += a*t*(2.0*cp - ct*sin(p));
7712          }
7713 
7714        /* Barycentric Earth position and velocity component. */
7715          pb[i] = xyz;
7716          vb[i] = xyzd / DJY;
7717 
7718        /* Next Cartesian component. */
7719        }
7720 
7721     /* Rotate from ecliptic to BCRS coordinates. */
7722 
7723        x = ph[0];
7724        y = ph[1];
7725        z = ph[2];
7726        pvh[0][0] =      x + am12*y + am13*z;
7727        pvh[0][1] = am21*x + am22*y + am23*z;
7728        pvh[0][2] =          am32*y + am33*z;
7729 
7730        x = vh[0];
7731        y = vh[1];
7732        z = vh[2];
7733        pvh[1][0] =      x + am12*y + am13*z;
7734        pvh[1][1] = am21*x + am22*y + am23*z;
7735        pvh[1][2] =          am32*y + am33*z;
7736 
7737        x = pb[0];
7738        y = pb[1];
7739        z = pb[2];
7740        pvb[0][0] =      x + am12*y + am13*z;
7741        pvb[0][1] = am21*x + am22*y + am23*z;
7742        pvb[0][2] =          am32*y + am33*z;
7743 
7744        x = vb[0];
7745        y = vb[1];
7746        z = vb[2];
7747        pvb[1][0] =      x + am12*y + am13*z;
7748        pvb[1][1] = am21*x + am22*y + am23*z;
7749        pvb[1][2] =          am32*y + am33*z;
7750 
7751     /* Return the status. */
7752        return jstat;
7753 
7754         }
7755     
7756 
7757     /**
7758     *  Equation of the equinoxes, IAU 1994 model.
7759     *
7760     *<p>This function is derived from the International Astronomical Union's
7761     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7762     *
7763     *<p>Status:  canonical model.
7764     *
7765     *<!-- Given: -->
7766     *     @param date1 double      TDB date (Note 1)
7767     *     @param date2 double      TDB date (Note 1) 
7768     *
7769     * <!-- Returned (function value): -->
7770     *  @return double     equation of the equinoxes (Note 2)
7771     *
7772     * <p>Notes:
7773     * <ol>
7774     *
7775     * <li> The date date1+date2 is a Julian Date, apportioned in any
7776     *     convenient way between the two arguments.  For example,
7777     *     JD(TT)=2450123.7 could be expressed in any of these ways,
7778     *     among others:
7779     *<pre>
7780     *            date1          date2
7781     *
7782     *         2450123.7           0.0       (JD method)
7783     *         2451545.0       -1421.3       (J2000 method)
7784     *         2400000.5       50123.2       (MJD method)
7785     *         2450123.5           0.2       (date &amp; time method)
7786     *</pre>
7787     *     The JD method is the most natural and convenient to use in
7788     *     cases where the loss of several decimal digits of resolution
7789     *     is acceptable.  The J2000 method is best matched to the way
7790     *     the argument is handled internally and will deliver the
7791     *     optimum resolution.  The MJD method and the date &amp; time methods
7792     *     are both good compromises between resolution and convenience.
7793     *
7794     * <li> The result, which is in radians, operates in the following sense:
7795     *
7796     *        Greenwich apparent ST = GMST + equation of the equinoxes
7797     *</ol>
7798     *<p>Called:<ul>
7799     *     <li>{@link #jauNut80} nutation, IAU 1980
7800     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
7801     * </ul>
7802     *<p>References:
7803     *
7804     *     <p>IAU Resolution C7, Recommendation 3 (1994).
7805     *
7806     *     <p>Capitaine, N. &amp; Gontier, A.-M., 1993, Astron. Astrophys., 275,
7807     *     645-650.
7808     *
7809     *@version 2008 May 24
7810     *
7811     *  @since Release 20101201
7812     *
7813     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7814     */
7815     public static double jauEqeq94(double date1, double date2)
7816     {
7817        double t,  om,  eps0, ee;
7818 
7819 
7820     /* Interval between fundamental epoch J2000.0 and given date (JC). */
7821        t = ((date1 - DJ00) + date2) / DJC;
7822 
7823     /* Longitude of the mean ascending node of the lunar orbit on the */
7824     /* ecliptic, measured from the mean equinox of date. */
7825        om = jauAnpm((450160.280 + (-482890.539
7826                + (7.455 + 0.008 * t) * t) * t) * DAS2R
7827                + fmod(-5.0 * t, 1.0) * D2PI);
7828 
7829     /* Nutation components and mean obliquity. */
7830        NutationTerms nt = jauNut80(date1, date2);
7831        eps0 = jauObl80(date1, date2);
7832 
7833     /* Equation of the equinoxes. */
7834        ee = nt.dpsi*cos(eps0) + DAS2R*(0.00264*sin(om) + 0.000063*sin(om+om));
7835 
7836        return ee;
7837 
7838         }
7839     
7840 
7841     /**
7842     *  Earth rotation angle (IAU 2000 model).
7843     *
7844     *<p>This function is derived from the International Astronomical Union's
7845     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7846     *
7847     *<p>Status:  canonical model.
7848     *
7849     *<!-- Given: -->
7850     *     @param dj1 double     UT1 as a 2-part Julian Date (see note)
7851     *     @param dj2 double     UT1 as a 2-part Julian Date (see note) 
7852     *
7853     * <!-- Returned (function value): -->
7854     *  @return double    Earth rotation angle (radians), range 0-2pi
7855     *
7856     * <p>Notes:
7857     * <ol>
7858     *
7859     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
7860     *     convenient way between the arguments dj1 and dj2.  For example,
7861     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
7862     *     among others:
7863     *<pre>
7864     *             dj1            dj2
7865     *
7866     *         2450123.7           0.0       (JD method)
7867     *         2451545.0       -1421.3       (J2000 method)
7868     *         2400000.5       50123.2       (MJD method)
7869     *         2450123.5           0.2       (date &amp; time method)
7870     *</pre>
7871     *     The JD method is the most natural and convenient to use in
7872     *     cases where the loss of several decimal digits of resolution
7873     *     is acceptable.  The J2000 and MJD methods are good compromises
7874     *     between resolution and convenience.  The date &amp; time method is
7875     *     best matched to the algorithm used:  maximum precision is
7876     *     delivered when the dj1 argument is for 0hrs UT1 on the day in
7877     *     question and the dj2 argument lies in the range 0 to 1, or vice
7878     *     versa.
7879     *
7880     * <li> The algorithm is adapted from Expression 22 of Capitaine et al.
7881     *     2000.  The time argument has been expressed in days directly,
7882     *     and, to retain precision, integer contributions have been
7883     *     eliminated.  The same formulation is given in IERS Conventions
7884     *     (2003), Chap. 5, Eq. 14.
7885     *</ol>
7886     *<p>Called:<ul>
7887     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
7888     * </ul>
7889     *<p>References:
7890     *
7891     *     <p>Capitaine N., Guinot B. and McCarthy D.D, 2000, Astron.
7892     *     Astrophys., 355, 398-405.
7893     *
7894     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7895     *     IERS Technical Note No. 32, BKG (2004)
7896     *
7897     *@version 2008 May 24
7898     *
7899     *  @since Release 20101201
7900     *
7901     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7902     */
7903     public static double jauEra00(double dj1, double dj2)
7904     {
7905        double d1, d2, t, f, theta;
7906 
7907 
7908     /* Days since fundamental epoch. */
7909        if (dj1 < dj2) {
7910           d1 = dj1;
7911           d2 = dj2;
7912        } else {
7913           d1 = dj2;
7914           d2 = dj1;
7915        }
7916        t = d1 + (d2- DJ00);
7917 
7918     /* Fractional part of T (days). */
7919        f = fmod(d1, 1.0) + fmod(d2, 1.0);
7920 
7921     /* Earth rotation angle at this UT1. */
7922        theta = jauAnp(D2PI * (f + 0.7790572732640
7923                                 + 0.00273781191135448 * t));
7924 
7925        return theta;
7926 
7927         }
7928     
7929 
7930     /**
7931     *  Fundamental argument, IERS Conventions (2003):
7932     *  mean elongation of the Moon from the Sun.
7933     *
7934     *<p>This function is derived from the International Astronomical Union's
7935     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7936     *
7937     *<p>Status:  canonical model.
7938     *
7939     *<!-- Given: -->
7940     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
7941     *
7942     * <!-- Returned (function value): -->
7943     *  @return double    D, radians (Note 2)
7944     *
7945     * <p>Notes:
7946     * <ol>
7947     *
7948     * <li> Though t is strictly TDB, it is usually more convenient to use
7949     *     TT, which makes no significant difference.
7950     *
7951     * <li> The expression used is as adopted in IERS Conventions (2003) and
7952     *     is from Simon et al. (1994).
7953     *</ol>
7954     *<p>References:
7955     *
7956     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
7957     *     IERS Technical Note No. 32, BKG (2004)
7958     *
7959     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
7960     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
7961     *
7962     *@version 2009 December 16
7963     *
7964     *  @since Release 20101201
7965     *
7966     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
7967     */
7968     public static double jauFad03(double t)
7969     {
7970        double a;
7971 
7972 
7973     /* Mean elongation of the Moon from the Sun (IERS Conventions 2003). */
7974        a = fmod(          1072260.703692 +
7975                  t * ( 1602961601.2090 +
7976                  t * (        - 6.3706 +
7977                  t * (          0.006593 +
7978                  t * (        - 0.00003169 ) ) ) ), TURNAS ) * DAS2R;
7979 
7980        return a;
7981 
7982         }
7983     
7984 
7985     /**
7986     *  Fundamental argument, IERS Conventions (2003):
7987     *  mean longitude of Earth.
7988     *
7989     *<p>This function is derived from the International Astronomical Union's
7990     *  SOFA (Standards Of Fundamental Astronomy) software collection.
7991     *
7992     *<p>Status:  canonical model.
7993     *
7994     *<!-- Given: -->
7995     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
7996     *
7997     * <!-- Returned (function value): -->
7998     *  @return double    mean longitude of Earth, radians (Note 2)
7999     *
8000     * <p>Notes:
8001     * <ol>
8002     *
8003     * <li> Though t is strictly TDB, it is usually more convenient to use
8004     *     TT, which makes no significant difference.
8005     *
8006     * <li> The expression used is as adopted in IERS Conventions (2003) and
8007     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8008     *</ol>
8009     *<p>References:
8010     *
8011     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8012     *     IERS Technical Note No. 32, BKG (2004)
8013     *
8014     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8015     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8016     *
8017     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8018     *     Astron.Astrophys.Supp.Ser. 135, 111
8019     *
8020     *@version 2009 December 16
8021     *
8022     *  @since Release 20101201
8023     *
8024     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8025     */
8026     public static double jauFae03(double t)
8027     {
8028        double a;
8029 
8030 
8031     /* Mean longitude of Earth (IERS Conventions 2003). */
8032        a = fmod(1.753470314 + 628.3075849991 * t, D2PI);
8033 
8034        return a;
8035 
8036         }
8037     
8038 
8039     /**
8040     *  Fundamental argument, IERS Conventions (2003):
8041     *  mean longitude of the Moon minus mean longitude of the ascending
8042     *  node.
8043     *
8044     *<p>This function is derived from the International Astronomical Union's
8045     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8046     *
8047     *<p>Status:  canonical model.
8048     *
8049     *<!-- Given: -->
8050     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8051     *
8052     * <!-- Returned (function value): -->
8053     *  @return double    F, radians (Note 2)
8054     *
8055     * <p>Notes:
8056     * <ol>
8057     *
8058     * <li> Though t is strictly TDB, it is usually more convenient to use
8059     *     TT, which makes no significant difference.
8060     *
8061     * <li> The expression used is as adopted in IERS Conventions (2003) and
8062     *     is from Simon et al. (1994).
8063     *</ol>
8064     *<p>References:
8065     *
8066     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8067     *     IERS Technical Note No. 32, BKG (2004)
8068     *
8069     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8070     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8071     *
8072     *@version 2009 December 16
8073     *
8074     *  @since Release 20101201
8075     *
8076     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8077     */
8078     public static double jauFaf03(double t)
8079     {
8080        double a;
8081 
8082 
8083     /* Mean longitude of the Moon minus that of the ascending node */
8084     /* (IERS Conventions 2003).                                    */
8085        a = fmod(           335779.526232 +
8086                  t * ( 1739527262.8478 +
8087                  t * (       - 12.7512 +
8088                  t * (        - 0.001037 +
8089                  t * (          0.00000417 ) ) ) ), TURNAS ) * DAS2R;
8090 
8091        return a;
8092 
8093 
8094         }
8095     
8096 
8097     /**
8098     *  Fundamental argument, IERS Conventions (2003):
8099     *  mean longitude of Jupiter.
8100     *
8101     *<p>This function is derived from the International Astronomical Union's
8102     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8103     *
8104     *<p>Status:  canonical model.
8105     *
8106     *<!-- Given: -->
8107     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8108     *
8109     * <!-- Returned (function value): -->
8110     *  @return double    mean longitude of Jupiter, radians (Note 2)
8111     *
8112     * <p>Notes:
8113     * <ol>
8114     *
8115     * <li> Though t is strictly TDB, it is usually more convenient to use
8116     *     TT, which makes no significant difference.
8117     *
8118     * <li> The expression used is as adopted in IERS Conventions (2003) and
8119     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8120     *</ol>
8121     *<p>References:
8122     *
8123     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8124     *     IERS Technical Note No. 32, BKG (2004)
8125     *
8126     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8127     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8128     *
8129     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8130     *     Astron.Astrophys.Supp.Ser. 135, 111
8131     *
8132     *@version 2009 December 16
8133     *
8134     *  @since Release 20101201
8135     *
8136     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8137     */
8138     public static double jauFaju03(double t)
8139     {
8140        double a;
8141 
8142 
8143     /* Mean longitude of Jupiter (IERS Conventions 2003). */
8144        a = fmod(0.599546497 + 52.9690962641 * t, D2PI);
8145 
8146        return a;
8147 
8148         }
8149     
8150 
8151     /**
8152     *  Fundamental argument, IERS Conventions (2003):
8153     *  mean anomaly of the Moon.
8154     *
8155     *<p>This function is derived from the International Astronomical Union's
8156     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8157     *
8158     *<p>Status:  canonical model.
8159     *
8160     *<!-- Given: -->
8161     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8162     *
8163     * <!-- Returned (function value): -->
8164     *  @return double    l, radians (Note 2)
8165     *
8166     * <p>Notes:
8167     * <ol>
8168     *
8169     * <li> Though t is strictly TDB, it is usually more convenient to use
8170     *     TT, which makes no significant difference.
8171     *
8172     * <li> The expression used is as adopted in IERS Conventions (2003) and
8173     *     is from Simon et al. (1994).
8174     *</ol>
8175     *<p>References:
8176     *
8177     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8178     *     IERS Technical Note No. 32, BKG (2004)
8179     *
8180     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8181     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8182     *
8183     *@version 2009 December 16
8184     *
8185     *  @since Release 20101201
8186     *
8187     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8188     */
8189     public static double jauFal03(double t)
8190     {
8191        double a;
8192 
8193 
8194     /* Mean anomaly of the Moon (IERS Conventions 2003). */
8195        a = fmod(           485868.249036  +
8196                  t * ( 1717915923.2178 +
8197                  t * (         31.8792 +
8198                  t * (          0.051635 +
8199                  t * (        - 0.00024470 ) ) ) ), TURNAS ) * DAS2R;
8200 
8201        return a;
8202 
8203         }
8204     
8205 
8206     /**
8207     *  Fundamental argument, IERS Conventions (2003):
8208     *  mean anomaly of the Sun.
8209     *
8210     *<p>This function is derived from the International Astronomical Union's
8211     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8212     *
8213     *<p>Status:  canonical model.
8214     *
8215     *<!-- Given: -->
8216     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8217     *
8218     * <!-- Returned (function value): -->
8219     *  @return double    l', radians (Note 2)
8220     *
8221     * <p>Notes:
8222     * <ol>
8223     *
8224     * <li> Though t is strictly TDB, it is usually more convenient to use
8225     *     TT, which makes no significant difference.
8226     *
8227     * <li> The expression used is as adopted in IERS Conventions (2003) and
8228     *     is from Simon et al. (1994).
8229     *</ol>
8230     *<p>References:
8231     *
8232     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8233     *     IERS Technical Note No. 32, BKG (2004)
8234     *
8235     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8236     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8237     *
8238     *@version 2009 December 16
8239     *
8240     *  @since Release 20101201
8241     *
8242     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8243     */
8244     public static double jauFalp03(double t)
8245     {
8246        double a;
8247 
8248 
8249     /* Mean anomaly of the Sun (IERS Conventions 2003). */
8250        a = fmod(         1287104.793048 +
8251                  t * ( 129596581.0481 +
8252                  t * (       - 0.5532 +
8253                  t * (         0.000136 +
8254                  t * (       - 0.00001149 ) ) ) ), TURNAS ) * DAS2R;
8255 
8256        return a;
8257 
8258         }
8259     
8260 
8261     /**
8262     *  Fundamental argument, IERS Conventions (2003):
8263     *  mean longitude of Mars.
8264     *
8265     *<p>This function is derived from the International Astronomical Union's
8266     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8267     *
8268     *<p>Status:  canonical model.
8269     *
8270     *<!-- Given: -->
8271     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8272     *
8273     * <!-- Returned (function value): -->
8274     *  @return double    mean longitude of Mars, radians (Note 2)
8275     *
8276     * <p>Notes:
8277     * <ol>
8278     *
8279     * <li> Though t is strictly TDB, it is usually more convenient to use
8280     *     TT, which makes no significant difference.
8281     *
8282     * <li> The expression used is as adopted in IERS Conventions (2003) and
8283     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8284     *</ol>
8285     *<p>References:
8286     *
8287     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8288     *     IERS Technical Note No. 32, BKG (2004)
8289     *
8290     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8291     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8292     *
8293     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8294     *     Astron.Astrophys.Supp.Ser. 135, 111
8295     *
8296     *@version 2009 December 16
8297     *
8298     *  @since Release 20101201
8299     *
8300     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8301     */
8302     public static double jauFama03(double t)
8303     {
8304        double a;
8305 
8306 
8307     /* Mean longitude of Mars (IERS Conventions 2003). */
8308        a = fmod(6.203480913 + 334.0612426700 * t, D2PI);
8309 
8310        return a;
8311 
8312         }
8313     
8314 
8315     /**
8316     *  Fundamental argument, IERS Conventions (2003):
8317     *  mean longitude of Mercury.
8318     *
8319     *<p>This function is derived from the International Astronomical Union's
8320     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8321     *
8322     *<p>Status:  canonical model.
8323     *
8324     *<!-- Given: -->
8325     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8326     *
8327     * <!-- Returned (function value): -->
8328     *  @return double    mean longitude of Mercury, radians (Note 2)
8329     *
8330     * <p>Notes:
8331     * <ol>
8332     *
8333     * <li> Though t is strictly TDB, it is usually more convenient to use
8334     *     TT, which makes no significant difference.
8335     *
8336     * <li> The expression used is as adopted in IERS Conventions (2003) and
8337     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8338     *</ol>
8339     *<p>References:
8340     *
8341     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8342     *     IERS Technical Note No. 32, BKG (2004)
8343     *
8344     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8345     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8346     *
8347     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8348     *     Astron.Astrophys.Supp.Ser. 135, 111
8349     *
8350     *@version 2009 December 16
8351     *
8352     *  @since Release 20101201
8353     *
8354     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8355     */
8356     public static double jauFame03(double t)
8357     {
8358        double a;
8359 
8360 
8361     /* Mean longitude of Mercury (IERS Conventions 2003). */
8362        a = fmod(4.402608842 + 2608.7903141574 * t, D2PI);
8363 
8364        return a;
8365 
8366         }
8367     
8368 
8369 
8370     /**
8371     *  Fundamental argument, IERS Conventions (2003):
8372     *  mean longitude of Neptune.
8373     *
8374     *<p>This function is derived from the International Astronomical Union's
8375     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8376     *
8377     *<p>Status:  canonical model.
8378     *
8379     *<!-- Given: -->
8380     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8381     *
8382     * <!-- Returned (function value): -->
8383     *  @return double    mean longitude of Neptune, radians (Note 2)
8384     *
8385     * <p>Notes:
8386     * <ol>
8387     *
8388     * <li> Though t is strictly TDB, it is usually more convenient to use
8389     *     TT, which makes no significant difference.
8390     *
8391     * <li> The expression used is as adopted in IERS Conventions (2003) and
8392     *     is adapted from Simon et al. (1994).
8393     *</ol>
8394     *<p>References:
8395     *
8396     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8397     *     IERS Technical Note No. 32, BKG (2004)
8398     *
8399     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8400     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8401     *
8402     *@version 2009 December 16
8403     *
8404     *  @since Release 20101201
8405     *
8406     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8407     */
8408     public static double jauFane03(double t)
8409     {
8410        double a;
8411 
8412 
8413     /* Mean longitude of Neptune (IERS Conventions 2003). */
8414        a = fmod(5.311886287 + 3.8133035638 * t, D2PI);
8415 
8416        return a;
8417 
8418         }
8419     
8420 
8421     /**
8422     *  Fundamental argument, IERS Conventions (2003):
8423     *  mean longitude of the Moon's ascending node.
8424     *
8425     *<p>This function is derived from the International Astronomical Union's
8426     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8427     *
8428     *<p>Status:  canonical model.
8429     *
8430     *<!-- Given: -->
8431     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8432     *
8433     * <!-- Returned (function value): -->
8434     *  @return double    Omega, radians (Note 2)
8435     *
8436     * <p>Notes:
8437     * <ol>
8438     *
8439     * <li> Though t is strictly TDB, it is usually more convenient to use
8440     *     TT, which makes no significant difference.
8441     *
8442     * <li> The expression used is as adopted in IERS Conventions (2003) and
8443     *     is from Simon et al. (1994).
8444     *</ol>
8445     *<p>References:
8446     *
8447     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8448     *     IERS Technical Note No. 32, BKG (2004)
8449     *
8450     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8451     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8452     *
8453     *@version 2009 December 16
8454     *
8455     *  @since Release 20101201
8456     *
8457     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8458     */
8459     public static double jauFaom03(double t)
8460     {
8461        double a;
8462 
8463 
8464     /* Mean longitude of the Moon's ascending node */
8465     /* (IERS Conventions 2003).                    */
8466        a = fmod(          450160.398036 +
8467                  t * ( - 6962890.5431 +
8468                  t * (         7.4722 +
8469                  t * (         0.007702 +
8470                  t * (       - 0.00005939 ) ) ) ), TURNAS ) * DAS2R;
8471 
8472        return a;
8473 
8474         }
8475     
8476 
8477     /**
8478     *  Fundamental argument, IERS Conventions (2003):
8479     *  general accumulated precession in longitude.
8480     *
8481     *<p>This function is derived from the International Astronomical Union's
8482     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8483     *
8484     *<p>Status:  canonical model.
8485     *
8486     *<!-- Given: -->
8487     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8488     *
8489     * <!-- Returned (function value): -->
8490     *  @return double    general precession in longitude, radians (Note 2)
8491     *
8492     * <p>Notes:
8493     * <ol>
8494     *
8495     * <li> Though t is strictly TDB, it is usually more convenient to use
8496     *     TT, which makes no significant difference.
8497     *
8498     * <li> The expression used is as adopted in IERS Conventions (2003).  It
8499     *     is taken from Kinoshita &amp; Souchay (1990) and comes originally
8500     *     from Lieske et al. (1977).
8501     *</ol>
8502     *<p>References:
8503     *
8504     *     Kinoshita, H. and Souchay J. 1990, Celest.Mech. and Dyn.Astron.
8505     *     48, 187
8506     *
8507     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
8508     *     Astron.Astrophys. 58, 1-16
8509     *
8510     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8511     *     IERS Technical Note No. 32, BKG (2004)
8512     *
8513     *@version 2009 December 16
8514     *
8515     *  @since Release 20101201
8516     *
8517     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8518     */
8519     public static double jauFapa03(double t)
8520     {
8521        double a;
8522 
8523 
8524     /* General accumulated precession in longitude. */
8525        a = (0.024381750 + 0.00000538691 * t) * t;
8526 
8527        return a;
8528 
8529         }
8530     
8531 
8532     /**
8533     *  Fundamental argument, IERS Conventions (2003):
8534     *  mean longitude of Saturn.
8535     *
8536     *<p>This function is derived from the International Astronomical Union's
8537     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8538     *
8539     *<p>Status:  canonical model.
8540     *
8541     *<!-- Given: -->
8542     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8543     *
8544     * <!-- Returned (function value): -->
8545     *  @return double    mean longitude of Saturn, radians (Note 2)
8546     *
8547     * <p>Notes:
8548     * <ol>
8549     *
8550     * <li> Though t is strictly TDB, it is usually more convenient to use
8551     *     TT, which makes no significant difference.
8552     *
8553     * <li> The expression used is as adopted in IERS Conventions (2003) and
8554     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8555     *</ol>
8556     *<p>References:
8557     *
8558     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8559     *     IERS Technical Note No. 32, BKG (2004)
8560     *
8561     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8562     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8563     *
8564     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8565     *     Astron.Astrophys.Supp.Ser. 135, 111
8566     *
8567     *@version 2009 December 16
8568     *
8569     *  @since Release 20101201
8570     *
8571     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8572     */
8573     public static double jauFasa03(double t)
8574     {
8575        double a;
8576 
8577 
8578     /* Mean longitude of Saturn (IERS Conventions 2003). */
8579        a = fmod(0.874016757 + 21.3299104960 * t, D2PI);
8580 
8581        return a;
8582 
8583         }
8584     
8585 
8586     /**
8587     *  Fundamental argument, IERS Conventions (2003):
8588     *  mean longitude of Uranus.
8589     *
8590     *<p>This function is derived from the International Astronomical Union's
8591     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8592     *
8593     *<p>Status:  canonical model.
8594     *
8595     *<!-- Given: -->
8596     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8597     *
8598     * <!-- Returned  (function value): -->
8599     *      @return     double    mean longitude of Uranus, radians (Note 2)
8600     *
8601     * <p>Notes:
8602     * <ol>
8603     *
8604     * <li> Though t is strictly TDB, it is usually more convenient to use
8605     *     TT, which makes no significant difference.
8606     *
8607     * <li> The expression used is as adopted in IERS Conventions (2003) and
8608     *     is adapted from Simon et al. (1994).
8609     *</ol>
8610     *<p>References:
8611     *
8612     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8613     *     IERS Technical Note No. 32, BKG (2004)
8614     *
8615     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8616     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8617     *
8618     *@version 2009 December 16
8619     *
8620     *  @since Release 20101201
8621     *
8622     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8623     */
8624     public static double jauFaur03(double t)
8625     {
8626        double a;
8627 
8628 
8629     /* Mean longitude of Uranus (IERS Conventions 2003). */
8630        a = fmod(5.481293872 + 7.4781598567 * t, D2PI);
8631 
8632        return a;
8633 
8634         }
8635     
8636 
8637     /**
8638     *  Fundamental argument, IERS Conventions (2003):
8639     *  mean longitude of Venus.
8640     *
8641     *<p>This function is derived from the International Astronomical Union's
8642     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8643     *
8644     *<p>Status:  canonical model.
8645     *
8646     *<!-- Given: -->
8647     *     @param t      double     TDB, Julian centuries since J2000.0 (Note 1)
8648     *
8649     * <!-- Returned (function value): -->
8650     *  @return double    mean longitude of Venus, radians (Note 2)
8651     *
8652     * <p>Notes:
8653     * <ol>
8654     *
8655     * <li> Though t is strictly TDB, it is usually more convenient to use
8656     *     TT, which makes no significant difference.
8657     *
8658     * <li> The expression used is as adopted in IERS Conventions (2003) and
8659     *     comes from Souchay et al. (1999) after Simon et al. (1994).
8660     *</ol>
8661     *<p>References:
8662     *
8663     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
8664     *     IERS Technical Note No. 32, BKG (2004)
8665     *
8666     *     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
8667     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
8668     *
8669     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
8670     *     Astron.Astrophys.Supp.Ser. 135, 111
8671     *
8672     *@version 2009 December 16
8673     *
8674     *  @since Release 20101201
8675     *
8676     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8677     */
8678     public static double jauFave03(double t)
8679     {
8680        double a;
8681 
8682 
8683     /* Mean longitude of Venus (IERS Conventions 2003). */
8684        a = fmod(3.176146697 + 1021.3285546211 * t, D2PI);
8685 
8686        return a;
8687 
8688         }
8689     
8690 
8691     /**
8692     *  Transform FK5 (J2000.0) star data into the Hipparcos system.
8693     *
8694     *<p>This function is derived from the International Astronomical Union's
8695     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8696     *
8697     *<p>Status:  support function.
8698     *
8699     *  Given (all FK5, equinox J2000.0, epoch J2000.0):
8700     *    @param r5      double    RA (radians)
8701     *    @param d5      double    Dec (radians)
8702     *    @param dr5     double    proper motion in RA (dRA/dt, rad/Jyear)
8703     *    @param dd5     double    proper motion in Dec (dDec/dt, rad/Jyear)
8704     *    @param px5     double    parallax (arcsec)
8705     *    @param rv5     double    radial velocity (km/s, positive = receding)
8706     *
8707     *  Returned (all Hipparcos, epoch J2000.0):
8708     *  @return catalogue coordinates
8709     *
8710     * <p>Notes:
8711     * <ol>
8712     *
8713     * <li> This function transforms FK5 star positions and proper motions
8714     *     into the system of the Hipparcos catalog.
8715     *
8716     * <li> The proper motions in RA are dRA/dt rather than
8717     *     cos(Dec)*dRA/dt, and are per year rather than per century.
8718     *
8719     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8720     *     rotation and spin;  zonal errors in the FK5 catalog are not
8721     *     taken into account.
8722     *
8723     * <li> See also {@link #jauH2fk5}, {@link #jauFk5hz}, {@link #jauHfk5z}.
8724     *</ol>
8725     *<p>Called:<ul>
8726     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
8727     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8728     *     <li>{@link #jauRxp} product of r-matrix and p-vector
8729     *     <li>{@link #jauPxp} vector product of two p-vectors
8730     *     <li>{@link #jauPpp} p-vector plus p-vector
8731     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
8732     * </ul>
8733     *<p>Reference:
8734     *
8735     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8736     *
8737     *@version 2009 December 17
8738     *
8739     *  @since Release 20101201
8740     *
8741     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8742     */
8743     public static CatalogCoords jauFk52h(double r5, double d5,
8744                   double dr5, double dd5, double px5, double rv5)
8745     {
8746        int i;
8747        double pv5[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pvh[][] = new double[2][3];
8748 
8749 
8750     /* FK5 barycentric position/velocity pv-vector (normalized). */
8751        jauStarpv(r5, d5, dr5, dd5, px5, rv5, pv5);
8752 
8753     /* FK5 to Hipparcos orientation matrix and spin vector. */
8754        jauFk5hip(r5h, s5h);
8755 
8756     /* Make spin units per day instead of per year. */
8757        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
8758 
8759     /* Orient the FK5 position into the Hipparcos system. */
8760        pvh[0] = jauRxp(r5h, pv5[0]);
8761 
8762     /* Apply spin to the position giving an extra space motion component. */
8763        wxp = jauPxp(pv5[0],s5h);
8764 
8765     /* Add this component to the FK5 space motion. */
8766        vv = jauPpp(wxp, pv5[1]);
8767 
8768     /* Orient the FK5 space motion into the Hipparcos system. */
8769        pvh[1] = jauRxp(r5h, vv);
8770 
8771     /* Hipparcos pv-vector to spherical. */
8772        CatalogCoords cat = null;
8773        try {
8774            cat = jauPvstar(pvh);
8775        } catch (JSOFAInternalError e) {
8776            //original code ignored possibility of error too...
8777            e.printStackTrace();
8778        }
8779 
8780        return cat;
8781 
8782         }
8783     
8784 
8785     /**
8786     *  FK5 to Hipparcos rotation and spin.
8787     *
8788     *<p>This function is derived from the International Astronomical Union's
8789     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8790     *
8791     *<p>Status:  support function.
8792     *
8793     *<!-- Returned: -->
8794     *     @param r5h    double[3][3]    <u>returned</u> r-matrix: FK5 rotation wrt Hipparcos (Note 2)
8795     *     @param s5h    double[3]       <u>returned</u> r-vector: FK5 spin wrt Hipparcos (Note 3)
8796     *
8797     * <p>Notes:
8798     * <ol>
8799     *
8800     * <li> This function models the FK5 to Hipparcos transformation as a
8801     *     pure rotation and spin;  zonal errors in the FK5 catalogue are
8802     *     not taken into account.
8803     *
8804     * <li> The r-matrix r5h operates in the sense:
8805     *
8806     *           P_Hipparcos = r5h x P_FK5
8807     *
8808     *     where P_FK5 is a p-vector in the FK5 frame, and P_Hipparcos is
8809     *     the equivalent Hipparcos p-vector.
8810     *
8811     * <li> The r-vector s5h represents the time derivative of the FK5 to
8812     *     Hipparcos rotation.  The units are radians per year (Julian,
8813     *     TDB).
8814     *</ol>
8815     *<p>Called:<ul>
8816     *     <li>{@link #jauRv2m} r-vector to r-matrix
8817     * </ul>
8818     *<p>Reference:
8819     *
8820     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
8821     *
8822     *@version 2009 March 14
8823     *
8824     *  @since Release 20101201
8825     *
8826     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8827     */
8828     public static void jauFk5hip(double r5h[][], double s5h[] )
8829     {
8830        double v[] = new double[3];
8831 
8832     /* FK5 wrt Hipparcos orientation and spin (radians, radians/year) */
8833        double epx, epy, epz;
8834        double omx, omy, omz;
8835 
8836 
8837        epx = -19.9e-3 * DAS2R;
8838        epy =  -9.1e-3 * DAS2R;
8839        epz =  22.9e-3 * DAS2R;
8840 
8841        omx = -0.30e-3 * DAS2R;
8842        omy =  0.60e-3 * DAS2R;
8843        omz =  0.70e-3 * DAS2R;
8844 
8845     /* FK5 to Hipparcos orientation expressed as an r-vector. */
8846        v[0] = epx;
8847        v[1] = epy;
8848        v[2] = epz;
8849 
8850     /* Re-express as an r-matrix. */
8851        double[][] r5ht = jauRv2m(v);
8852        jauCr(r5ht, r5h);
8853 
8854     /* Hipparcos wrt FK5 spin expressed as an r-vector. */
8855        s5h[0] = omx;
8856        s5h[1] = omy;
8857        s5h[2] = omz;
8858 
8859        return;
8860 
8861         }
8862     
8863   /**
8864   * Position consisting of (&alpha;, &delta;) pairs in radians. Where &alpha; is right ascension (or longitude angle) and &delta; is declination (or latitude angle).
8865  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
8866  * 
8867  * @since AIDA Stage 1
8868  * @TODO needs better name cf {@link SphericalPosition}
8869  */
8870 public static class SphericalCoordinate {
8871       public double alpha;
8872       public double delta;
8873       public SphericalCoordinate(double alpha, double delta){
8874           this.alpha = alpha;
8875           this.delta = delta;
8876       }
8877   }
8878 
8879 /**
8880  * Spherical coordinate with equation of origins .
8881  * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
8882  * @version $Revision$ $date$
8883  */
8884 public static class SphericalCoordinateEO {
8885     public SphericalCoordinate pos;
8886     public double eo;
8887     /**
8888      * @param pos
8889      * @param eo
8890      */
8891     public SphericalCoordinateEO(SphericalCoordinate pos, double eo) {
8892         this.pos = pos;
8893         this.eo = eo;
8894     }
8895     
8896     
8897 }
8898     /**
8899     *  Transform an FK5 (J2000.0) star position into the system of the
8900     *  Hipparcos catalogue, assuming zero Hipparcos proper motion.
8901     *
8902     *<p>This function is derived from the International Astronomical Union's
8903     *  SOFA (Standards Of Fundamental Astronomy) software collection.
8904     *
8905     *<p>Status:  support function.
8906     *
8907     *<!-- Given: -->
8908     *     @param r5            double    FK5 RA (radians), equinox J2000.0, at date
8909     *     @param d5            double    FK5 Dec (radians), equinox J2000.0, at date
8910     *     @param date1 double    TDB date (Notes 1,2)
8911     *     @param date2 double    TDB date (Notes 1,2) 
8912     *
8913     *<!-- Returned: -->
8914     *     @return rh            double     <u>returned</u> Hipparcos RA (radians)
8915     *             dh            double     <u>returned</u> Hipparcos Dec (radians)
8916     *
8917     * <p>Notes:
8918     * <ol>
8919     *
8920     * <li> This function converts a star position from the FK5 system to
8921     *     the Hipparcos system, in such a way that the Hipparcos proper
8922     *     motion is zero.  Because such a star has, in general, a non-zero
8923     *     proper motion in the FK5 system, the function requires the date
8924     *     at which the position in the FK5 system was determined.
8925     *
8926     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
8927     *     convenient way between the two arguments.  For example,
8928     *     JD(TT)=2450123.7 could be expressed in any of these ways,
8929     *     among others:
8930     *<pre>
8931     *            date1          date2
8932     *
8933     *         2450123.7           0.0       (JD method)
8934     *         2451545.0       -1421.3       (J2000 method)
8935     *         2400000.5       50123.2       (MJD method)
8936     *         2450123.5           0.2       (date &amp; time method)
8937     *</pre>
8938     *     The JD method is the most natural and convenient to use in
8939     *     cases where the loss of several decimal digits of resolution
8940     *     is acceptable.  The J2000 method is best matched to the way
8941     *     the argument is handled internally and will deliver the
8942     *     optimum resolution.  The MJD method and the date &amp; time methods
8943     *     are both good compromises between resolution and convenience.
8944     *
8945     * <li> The FK5 to Hipparcos transformation is modeled as a pure
8946     *     rotation and spin;  zonal errors in the FK5 catalogue are not
8947     *     taken into account.
8948     *
8949     * <li> The position returned by this function is in the Hipparcos
8950     *     reference system but at date date1+date2.
8951     *
8952     * <li> See also jauFk52h, jauH2fk5, jauHfk5z.
8953     *</ol>
8954     *<p>Called:<ul>
8955     *     <li>{@link #jauS2c} spherical coordinates to unit vector
8956     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
8957     *     <li>{@link #jauSxp} multiply p-vector by scalar
8958     *     <li>{@link #jauRv2m} r-vector to r-matrix
8959     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
8960     *     <li>{@link #jauPxp} vector product of two p-vectors
8961     *     <li>{@link #jauC2s} p-vector to spherical
8962     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
8963     * </ul>
8964     *<p>Reference:
8965     *
8966     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
8967     *
8968     *@version 2009 December 17
8969     *
8970     *  @since Release 20101201
8971     *
8972     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
8973     */
8974     public static SphericalCoordinate jauFk5hz(double r5, double d5, double date1, double date2
8975                   )
8976     {
8977        double t, p5e[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], vst[] = new double[3], rst[][] = new double[3][3], p5[] = new double[3],
8978               ph[] = new double[3];
8979 
8980 
8981     /* Interval from given date to fundamental epoch J2000.0 (JY). */
8982        t = - ((date1 - DJ00) + date2) / DJY;
8983 
8984     /* FK5 barycentric position vector. */
8985        p5e = jauS2c(r5,d5);
8986 
8987     /* FK5 to Hipparcos orientation matrix and spin vector. */
8988        jauFk5hip(r5h, s5h);
8989 
8990     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
8991        vst = jauSxp(t,s5h);
8992 
8993     /* Express the accumulated spin as a rotation matrix. */
8994        rst = jauRv2m(vst);
8995 
8996     /* Derotate the vector's FK5 axes back to date. */
8997        p5 = jauTrxp(rst, p5e);
8998 
8999     /* Rotate the vector into the Hipparcos system. */
9000        ph = jauRxp(r5h, p5);
9001 
9002     /* Hipparcos vector to spherical. */
9003        SphericalCoordinate sc = jauC2s(ph);
9004        double rh = jauAnp(sc.alpha);
9005        sc.alpha = rh;
9006        
9007        return sc;
9008 
9009         }
9010     
9011 
9012     /**
9013     *  Form rotation matrix given the Fukushima-Williams angles.
9014     *
9015     *<p>This function is derived from the International Astronomical Union's
9016     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9017     *
9018     *<p>Status:  support function.
9019     *
9020     *<!-- Given: -->
9021     *     @param gamb      double          F-W angle gamma_bar (radians)
9022     *     @param phib      double          F-W angle phi_bar (radians)
9023     *     @param psi       double          F-W angle psi (radians)
9024     *     @param eps       double          F-W angle epsilon (radians)
9025     *
9026     *<!-- Returned: -->
9027     *     @return r         double[3][3]     <u>returned</u> rotation matrix
9028     *
9029     * <p>Notes:
9030     * <ol>
9031     *
9032     * <li> Naming the following points:
9033     *
9034     *           e = J2000.0 ecliptic pole,
9035     *           p = GCRS pole,
9036     *           E = ecliptic pole of date,
9037     *     and   P = CIP,
9038     *
9039     *     the four Fukushima-Williams angles are as follows:
9040     *
9041     *        gamb = gamma = epE
9042     *        phib = phi = pE
9043     *        psi = psi = pEP
9044     *        eps = epsilon = EP
9045     *
9046     * <li> The matrix representing the combined effects of frame bias,
9047     *     precession and nutation is:
9048     *
9049     *        NxPxB = R_1(-eps).R_3(-psi).R_1(phib).R_3(gamb)
9050     *
9051     * <li> Three different matrices can be constructed, depending on the
9052     *     supplied angles:
9053     *
9054     *     o  To obtain the nutation x precession x frame bias matrix,
9055     *        generate the four precession angles, generate the nutation
9056     *        components and add them to the psi_bar and epsilon_A angles,
9057     *        and call the present function.
9058     *
9059     *     o  To obtain the precession x frame bias matrix, generate the
9060     *        four precession angles and call the present function.
9061     *
9062     *     o  To obtain the frame bias matrix, generate the four precession
9063     *        angles for date J2000.0 and call the present function.
9064     *
9065     *     The nutation-only and precession-only matrices can if necessary
9066     *     be obtained by combining these three appropriately.
9067     *</ol>
9068     *<p>Called:<ul>
9069     *     <li>{@link #jauIr} initialize r-matrix to identity
9070     *     <li>{@link #jauRz} rotate around Z-axis
9071     *     <li>{@link #jauRx} rotate around X-axis
9072     * </ul>
9073     *<p>Reference:
9074     *
9075     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9076     *
9077     *@version 2009 December 17
9078     *
9079     *  @since Release 20101201
9080     *
9081     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9082     */
9083     public static double[][] jauFw2m(double gamb, double phib, double psi, double eps)
9084     {
9085     /* Construct the matrix. */
9086        double r[][] = new double[3][3];
9087        jauIr(r);
9088        jauRz(gamb, r);
9089        jauRx(phib, r);
9090        jauRz(-psi, r);
9091        jauRx(-eps, r);
9092 
9093        return r;
9094 
9095         }
9096     
9097 
9098     /**
9099     *  CIP X,Y given Fukushima-Williams bias-precession-nutation angles.
9100     *
9101     *<p>This function is derived from the International Astronomical Union's
9102     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9103     *
9104     *<p>Status:  support function.
9105     *
9106     *<!-- Given: -->
9107     *     @param gamb      double     F-W angle gamma_bar (radians)
9108     *     @param phib      double     F-W angle phi_bar (radians)
9109     *     @param psi       double     F-W angle psi (radians)
9110     *     @param eps       double     F-W angle epsilon (radians)
9111     *
9112     *<!-- Returned: -->
9113     *     @return CIP unit vector X,Y
9114     *
9115     * <p>Notes:
9116     * <ol>
9117     *
9118     * <li> Naming the following points:
9119     *
9120     *           e = J2000.0 ecliptic pole,
9121     *           p = GCRS pole
9122     *           E = ecliptic pole of date,
9123     *     and   P = CIP,
9124     *
9125     *     the four Fukushima-Williams angles are as follows:
9126     *
9127     *        gamb = gamma = epE
9128     *        phib = phi = pE
9129     *        psi = psi = pEP
9130     *        eps = epsilon = EP
9131     *
9132     * <li> The matrix representing the combined effects of frame bias,
9133     *     precession and nutation is:
9134     *
9135     *        NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
9136     *
9137     *       The returned values x,y are elements [2][0] and [2][1] of the
9138     *       matrix.  Near J2000.0, they are essentially angles in radians
9139     *       
9140     *     X,Y are elements (3,1) and (3,2) of the matrix.
9141     *</ol>
9142     *<p>Called:<ul>
9143     *     <li>{@link #jauFw2m} F-W angles to r-matrix
9144     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
9145     * </ul>
9146     *<p>Reference:
9147     *
9148     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
9149     *
9150     *@version 2009 December 17
9151     *
9152     *  @since Release 20101201
9153     *
9154     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9155     */
9156     public static CelestialIntermediatePole jauFw2xy(double gamb, double phib, double psi, double eps)
9157     {
9158        double r[][] = new double[3][3];
9159 
9160 
9161     /* Form NxPxB matrix. */
9162        r = jauFw2m(gamb, phib, psi, eps);
9163 
9164     /* Extract CIP X,Y. */
9165        return jauBpn2xy(r);
9166 
9167     }
9168 
9169     /**
9170      * Geodetic coordinates.
9171      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
9172      * 
9173      * @since AIDA Stage 1
9174      */
9175     public static class GeodeticCoord {
9176         /** longitude (radians, east +ve) */
9177         public  double elong;
9178         /** latitude (geodetic, radians) */
9179         public double phi;
9180         /** height above ellipsoid (geodetic) */
9181         public double height;
9182         public GeodeticCoord(double elong, double phi, double height) {
9183             this.elong = elong;
9184             this.phi = phi;
9185             this.height = height;
9186         }
9187 }
9188     /**
9189     *  Transform geocentric coordinates to geodetic using the specified
9190     *  reference ellipsoid.
9191     *
9192     *<p>This function is derived from the International Astronomical Union's
9193     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9194     *
9195     *<p>Status:  canonical transformation.
9196     *
9197     *<!-- Given: -->
9198     *     @param n        int         ellipsoid identifier (Note 1)
9199     *     @param xyz      double[3]   geocentric vector (Note 2)
9200     *
9201     *<!-- Returned: -->
9202     *     @return elong    double       <u>returned</u> longitude (radians, east +ve)
9203     *             phi      double       <u>returned</u> latitude (geodetic, radians, Note 3)
9204     *             height   double       <u>returned</u> height above ellipsoid (geodetic, Notes 2,3)
9205     *
9206     * <!-- Returned (function value): -->
9207     *  @throws JSOFAIllegalParameter
9208     *                          0 = OK
9209     *                         -1 = illegal identifier (Note 3)
9210     *                         -2 = internal error (Note 3)
9211     *
9212     * <p>Notes:
9213     * <ol>
9214     *
9215     * <li> The identifier n is a number that specifies the choice of
9216     *     reference ellipsoid.  The following are supported:
9217     *
9218     *        n   ellipsoid
9219     *
9220     *        1    WGS84
9221     *        2    GRS80
9222     *
9223     *     The number n has no significance outside the JSOFA software.
9224     *
9225     * <li> The geocentric vector (xyz, given) and height (height, returned)
9226     *     are in meters.
9227     *
9228     * <li> An error status -1 means that the identifier n is illegal.  An
9229     *     error status -2 is theoretically impossible.  In all error cases,
9230     *     phi and height are both set to -1e9.
9231     *
9232     * <li> The inverse transformation is performed in the function jauGd2gc.
9233     *</ol>
9234     *<p>Called:<ul>
9235     *     <li>{@link #jauEform} Earth reference ellipsoids
9236     *     <li>{@link #jauGc2gde} geocentric to geodetic transformation, general
9237     * </ul>
9238     *@version 2010 January 18
9239     *
9240     *  @since Release 20101201
9241     *
9242     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9243     */
9244     public static GeodeticCoord jauGc2gd ( int n, double xyz[] ) throws JSOFAIllegalParameter
9245     {
9246       GeodeticCoord gc;
9247 
9248 
9249     /* Obtain reference ellipsoid parameters. */
9250        ReferenceEllipsoid el = jauEform ( n );
9251 
9252     /* If OK, transform x,y,z to longitude, geodetic latitude, height. */
9253        gc = jauGc2gde ( el.a, el.f, xyz);
9254 
9255     /* Return the status. */
9256        return gc;
9257 
9258     
9259     }
9260     
9261    /**
9262     *  Transform geocentric coordinates to geodetic for a reference
9263     *  ellipsoid of specified form.
9264     *
9265     *<p>This function is derived from the International Astronomical Union's
9266     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9267     *
9268     *<p>Status:  support function.
9269     *
9270     *<!-- Given: -->
9271     *     @param a        double      equatorial radius (Notes 2,4)
9272     *     @param f        double      flattening (Note 3)
9273     *     @param xyz      double[3]   geocentric vector (Note 4)
9274     *
9275     *<!-- Returned: -->
9276     *     @return GeodeticCoord   logitude  (radians, east +ve) latitude (geodetic, radians)  height above ellipsoid (geodetic, Note 4)
9277     *
9278     *  @throws JSOFAIllegalParameter 
9279     *            int       status:
9280     *               
9281     *                         -1 = illegal a
9282     *                         -2 = illegal f
9283     *
9284     * <p>Notes:
9285     * <ol>
9286     *
9287     * <li> This function is based on the GCONV2H Fortran subroutine by
9288     *     Toshio Fukushima (see reference).
9289     *
9290     * <li> The equatorial radius, a, can be in any units, but meters is
9291     *     the conventional choice.
9292     *
9293     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9294     *     i.e. around 1/298.
9295     *
9296     * <li> The equatorial radius, a, and the geocentric vector, xyz,
9297     *     must be given in the same units, and determine the units of
9298     *     the returned height, height.
9299     *
9300     * <li> If an error occurs (status &lt; 0), elong, phi and height are
9301     *     unchanged.
9302     *
9303     * <li> The inverse transformation is performed in the function
9304     *     jauGd2gce.
9305     *
9306     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9307     *     more conveniently be performed by calling jauGc2gd, which uses a
9308     *     numerical code (1 for WGS84) to identify the required A and F
9309     *     values.
9310     *</ol>
9311     *<p>Reference:
9312     *
9313     *     Fukushima, T., "Transformation from Cartesian to geodetic
9314     *     coordinates accelerated by Halley's method", J.Geodesy (2006)
9315     *     79: 689-693
9316     *
9317     *@version 2009 November 2
9318     *
9319     *  @since Release 20101201
9320     *
9321     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9322  * 
9323     */
9324     public static GeodeticCoord jauGc2gde ( double a, double f, double xyz[] ) throws JSOFAIllegalParameter
9325         {
9326        double aeps2, e2, e4t, ec2, ec, b, x, y, z, p2, absz, p, s0, pn, zc,
9327                      c0, c02, c03, s02, s03, a02, a0, a03, d0, f0, b0, s1,
9328                      cc, s12, cc2;
9329 
9330       double  phi, height;
9331     /* ------------- */
9332     /* Preliminaries */
9333     /* ------------- */
9334 
9335     /* Validate ellipsoid parameters. */
9336        if ( f < 0.0 || f >= 1.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9337        if ( a <= 0.0 ) throw new JSOFAIllegalParameter("bad a", -2);
9338 
9339     /* Functions of ellipsoid parameters (with further validation of f). */
9340        aeps2 = a*a * 1e-32;
9341        e2 = (2.0 - f) * f;
9342        e4t = e2*e2 * 1.5;
9343        ec2 = 1.0 - e2;
9344        if ( ec2 <= 0.0 ) throw new JSOFAIllegalParameter("bad f", -1);
9345        ec = sqrt(ec2);
9346        b = a * ec;
9347 
9348     /* Cartesian components. */
9349        x = xyz[0];
9350        y = xyz[1];
9351        z = xyz[2];
9352 
9353     /* Distance from polar axis squared. */
9354        p2 = x*x + y*y;
9355 
9356     /* Longitude. */
9357        double elong = p2 > 0.0 ? atan2(y, x) : 0.0;
9358 
9359     /* Unsigned z-coordinate. */
9360        absz = abs(z);
9361 
9362     /* Proceed unless polar case. */
9363        if ( p2 > aeps2 ) {
9364 
9365        /* Distance from polar axis. */
9366           p = sqrt(p2);
9367 
9368        /* Normalization. */
9369           s0 = absz / a;
9370           pn = p / a;
9371           zc = ec * s0;
9372 
9373        /* Prepare Newton correction factors. */
9374           c0 = ec * pn;
9375           c02 = c0 * c0;
9376           c03 = c02 * c0;
9377           s02 = s0 * s0;
9378           s03 = s02 * s0;
9379           a02 = c02 + s02;
9380           a0 = sqrt(a02);
9381           a03 = a02 * a0;
9382           d0 = zc*a03 + e2*s03;
9383           f0 = pn*a03 - e2*c03;
9384 
9385        /* Prepare Halley correction factor. */
9386           b0 = e4t * s02 * c02 * pn * (a0 - ec);
9387           s1 = d0*f0 - b0*s0;
9388           cc = ec * (f0*f0 - b0*c0);
9389 
9390        /* Evaluate latitude and height. */
9391           phi = atan(s1/cc);
9392           s12 = s1 * s1;
9393           cc2 = cc * cc;
9394           height = (p*cc + absz*s1 - a * sqrt(ec2*s12 + cc2)) /
9395                                                             sqrt(s12 + cc2);
9396        } else {
9397 
9398        /* Exception: pole. */
9399           phi = DPI / 2.0;
9400           height = absz - b;
9401        }
9402 
9403     /* Restore sign of latitude. */
9404        if ( z < 0 ) phi = -phi;
9405 
9406     /* OK status. */
9407        return new GeodeticCoord(elong, phi, height);
9408 
9409     
9410     }
9411     
9412 
9413     /**
9414     *  Transform geodetic coordinates to geocentric using the specified
9415     *  reference ellipsoid.
9416     *
9417     *<p>This function is derived from the International Astronomical Union's
9418     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9419     *
9420     *<p>Status:  canonical transformation.
9421     *
9422     *<!-- Given: -->
9423     *     @param n        int         ellipsoid identifier (Note 1)
9424     *     @param elong    double      longitude (radians, east +ve)
9425     *     @param phi      double      latitude (geodetic, radians, Note 3)
9426     *     @param height   double      height above ellipsoid (geodetic, Notes 2,3)
9427     *
9428     *<!-- Returned: -->
9429     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 2)
9430     *
9431     * <!-- Returned (function value): -->
9432     *  @throws JSOFAIllegalParameter
9433     *                         -1 = illegal identifier (Note 3)
9434     *                         -2 = illegal case (Note 3)
9435     *
9436     * <p>Notes:
9437     * <ol>
9438     *
9439     * <li> The identifier n is a number that specifies the choice of
9440     *     reference ellipsoid.  The following are supported:
9441     *
9442     *        n   ellipsoid
9443     *
9444     *        1    WGS84
9445     *        2    GRS80
9446     *
9447     *     The number n has no significance outside the JSOFA software.
9448     *
9449     * <li> The height (height, given) and the geocentric vector (xyz,
9450     *     returned) are in meters.
9451     *
9452     * <li> No validation is performed on the arguments elong, phi and
9453     *     height.  An error status -1 means that the identifier n is
9454     *     illegal.  An error status -2 protects against cases that would
9455     *     lead to arithmetic exceptions.  In all error cases, xyz is set
9456     *     to zeros.
9457     *
9458     * <li> The inverse transformation is performed in the function jauGc2gd.
9459     *</ol>
9460     *<p>Called:<ul>
9461     *     <li>{@link #jauEform} Earth reference ellipsoids
9462     *     <li>{@link #jauGd2gce} geodetic to geocentric transformation, general
9463     *     <li>{@link #jauZp} zero p-vector
9464     * </ul>
9465     *@version 2010 January 18
9466     *
9467     *  @since Release 20101201
9468     *
9469     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9470     */
9471     public static double[] jauGd2gc ( int n, double elong, double phi, double height ) throws JSOFAIllegalParameter, JSOFAInternalError
9472     {
9473 
9474 
9475     /* Obtain reference ellipsoid parameters. */
9476        ReferenceEllipsoid em = jauEform ( n );
9477 
9478     /* If OK, transform longitude, geodetic latitude, height to x,y,z. */
9479       return jauGd2gce ( em.a, em.f, elong, phi, height );
9480   
9481     
9482     }
9483     
9484 
9485     /**
9486     *  Transform geodetic coordinates to geocentric for a reference
9487     *  ellipsoid of specified form.
9488     *
9489     *<p>This function is derived from the International Astronomical Union's
9490     *  JSOFA (Standards of Fundamental Astronomy) software collection.
9491     *
9492     *<p>Status:  support function.
9493     *
9494     *<!-- Given: -->
9495     *     @param a        double      equatorial radius (Notes 1,4)
9496     *     @param f        double      flattening (Notes 2,4)
9497     *     @param elong    double      longitude (radians, east +ve)
9498     *     @param phi      double      latitude (geodetic, radians, Note 4)
9499     *     @param height   double      height above ellipsoid (geodetic, Notes 3,4)
9500     *
9501     *<!-- Returned: -->
9502     *     @return xyz      double[3]    <u>returned</u> geocentric vector (Note 3)
9503     *
9504     * <!-- Returned (function value): -->
9505     *  
9506     *  @throws JSOFAInternalError  0 = OK
9507     *                           -1 = illegal case (Note 4)
9508     * <p>Notes:
9509     * <ol>
9510     *
9511     * <li> The equatorial radius, a, can be in any units, but meters is
9512     *     the conventional choice.
9513     *
9514     * <li> The flattening, f, is (for the Earth) a value around 0.00335,
9515     *     i.e. around 1/298.
9516     *
9517     * <li> The equatorial radius, a, and the height, height, must be
9518     *     given in the same units, and determine the units of the
9519     *     returned geocentric vector, xyz.
9520     *
9521     * <li> No validation is performed on individual arguments.  The error
9522     *     status -1 protects against (unrealistic) cases that would lead
9523     *     to arithmetic exceptions.  If an error occurs, xyz is unchanged.
9524     *
9525     * <li> The inverse transformation is performed in the function
9526     *     jauGc2gde.
9527     *
9528     * <li> The transformation for a standard ellipsoid (such as WGS84) can
9529     *     more conveniently be performed by calling jauGd2gc,  which uses a
9530     *     numerical code (1 for WGS84) to identify the required a and f
9531     *     values.
9532     *</ol>
9533     *<p>References:
9534     *
9535     *     <p>Green, R.M., Spherical Astronomy, Cambridge University Press,
9536     *     (1985) Section 4.5, p96.
9537     *
9538     *     <p>Explanatory Supplement to the Astronomical Almanac,
9539     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
9540     *     Section 4.22, p202.
9541     *
9542     *@version 2009 November 2
9543     *
9544     *  @since Release 20101201
9545     *
9546     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9547     */
9548     public static double[] jauGd2gce ( double a, double f, double elong, double phi,
9549                     double height ) throws JSOFAInternalError
9550     {
9551        double sp, cp, w, d, ac, as, r;
9552        double xyz[] = new double[3];
9553 
9554 
9555     /* Functions of geodetic latitude. */
9556        sp = sin(phi);
9557        cp = cos(phi);
9558        w = 1.0 - f;
9559        w = w * w;
9560        d = cp*cp + w*sp*sp;
9561        if ( d <= 0.0 ) throw new JSOFAInternalError("illegal combination of arguments d< 0", -1);
9562        ac = a / sqrt(d);
9563        as = w * ac;
9564 
9565     /* Geocentric vector. */
9566        r = (ac + height) * cp;
9567        xyz[0] = r * cos(elong);
9568        xyz[1] = r * sin(elong);
9569        xyz[2] = (as + height) * sp;
9570 
9571     /* Success. */
9572        return xyz;
9573 
9574     
9575     }
9576     
9577 
9578     /**
9579     *  Greenwich mean sidereal time (model consistent with IAU 2000
9580     *  resolutions).
9581     *
9582     *<p>This function is derived from the International Astronomical Union's
9583     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9584     *
9585     *<p>Status:  canonical model.
9586     *
9587     *<!-- Given: -->
9588     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9589     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9590     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9591     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9592     *
9593     * <!-- Returned (function value): -->
9594     *  @return double    Greenwich mean sidereal time (radians)
9595     *
9596     * <p>Notes:
9597     * <ol>
9598     *
9599     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9600     *     Julian Dates, apportioned in any convenient way between the
9601     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9602     *     any of these ways, among others:
9603     *<pre>
9604     *            Part A         Part B
9605     *
9606     *         2450123.7           0.0       (JD method)
9607     *         2451545.0       -1421.3       (J2000 method)
9608     *         2400000.5       50123.2       (MJD method)
9609     *         2450123.5           0.2       (date &amp; time method)
9610     *</pre>
9611     *     The JD method is the most natural and convenient to use in
9612     *     cases where the loss of several decimal digits of resolution
9613     *     is acceptable (in the case of UT;  the TT is not at all critical
9614     *     in this respect).  The J2000 and MJD methods are good compromises
9615     *     between resolution and convenience.  For UT, the date &amp; time
9616     *     method is best matched to the algorithm that is used by the Earth
9617     *     Rotation Angle function, called internally:  maximum precision is
9618     *     delivered when the uta argument is for 0hrs UT1 on the day in
9619     *     question and the utb argument lies in the range 0 to 1, or vice
9620     *     versa.
9621     *
9622     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9623     *     and TT to predict the effects of precession.  If UT1 is used for
9624     *     both purposes, errors of order 100 microarcseconds result.
9625     *
9626     * <li> This GMST is compatible with the IAU 2000 resolutions and must be
9627     *     used only in conjunction with other IAU 2000 compatible
9628     *     components such as precession-nutation and equation of the
9629     *     equinoxes.
9630     *
9631     * <li> The result is returned in the range 0 to 2pi.
9632     *
9633     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9634     *     Conventions 2003.
9635     *</ol>
9636     *<p>Called:<ul>
9637     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9638     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9639     * </ul>
9640     *<p>References:
9641     *
9642     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9643     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9644     *     Astrophysics, 406, 1135-1149 (2003)
9645     *
9646     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9647     *     IERS Technical Note No. 32, BKG (2004)
9648     *
9649     *@version 2009 March 16
9650     *
9651     *  @since Release 20101201
9652     *
9653     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9654     */
9655     public static double jauGmst00(double uta, double utb, double tta, double ttb)
9656     {
9657        double t, gmst;
9658 
9659 
9660     /* TT Julian centuries since J2000.0. */
9661        t = ((tta - DJ00) + ttb) / DJC;
9662 
9663     /* Greenwich Mean Sidereal Time, IAU 2000. */
9664        gmst = jauAnp(jauEra00(uta, utb) +
9665                        (     0.014506   +
9666                        (  4612.15739966 +
9667                        (     1.39667721 +
9668                        (    -0.00009344 +
9669                        (     0.00001882 )
9670               * t) * t) * t) * t) * DAS2R);
9671 
9672        return gmst;
9673 
9674         }
9675     
9676 
9677     /**
9678     *  Greenwich mean sidereal time (consistent with IAU 2006 precession).
9679     *
9680     *<p>This function is derived from the International Astronomical Union's
9681     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9682     *
9683     *<p>Status:  canonical model.
9684     *
9685     *<!-- Given: -->
9686     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9687     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9688     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9689     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9690     *
9691     * <!-- Returned (function value): -->
9692     *  @return double    Greenwich mean sidereal time (radians)
9693     *
9694     * <p>Notes:
9695     * <ol>
9696     *
9697     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9698     *     Julian Dates, apportioned in any convenient way between the
9699     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9700     *     any of these ways, among others:
9701     *<pre>
9702     *            Part A        Part B
9703     *
9704     *         2450123.7           0.0       (JD method)
9705     *         2451545.0       -1421.3       (J2000 method)
9706     *         2400000.5       50123.2       (MJD method)
9707     *         2450123.5           0.2       (date &amp; time method)
9708     *</pre>
9709     *     The JD method is the most natural and convenient to use in
9710     *     cases where the loss of several decimal digits of resolution
9711     *     is acceptable (in the case of UT;  the TT is not at all critical
9712     *     in this respect).  The J2000 and MJD methods are good compromises
9713     *     between resolution and convenience.  For UT, the date &amp; time
9714     *     method is best matched to the algorithm that is used by the Earth
9715     *     rotation angle function, called internally:  maximum precision is
9716     *     delivered when the uta argument is for 0hrs UT1 on the day in
9717     *     question and the utb argument lies in the range 0 to 1, or vice
9718     *     versa.
9719     *
9720     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9721     *     and TT to predict the effects of precession.  If UT1 is used for
9722     *     both purposes, errors of order 100 microarcseconds result.
9723     *
9724     * <li> This GMST is compatible with the IAU 2006 precession and must not
9725     *     be used with other precession models.
9726     *
9727     * <li> The result is returned in the range 0 to 2pi.
9728     *</ol>
9729     *<p>Called:<ul>
9730     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
9731     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9732     * </ul>
9733     *<p>Reference:
9734     *
9735     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2005,
9736     *     Astron.Astrophys. 432, 355
9737     *
9738     *@version 2008 May 24
9739     *
9740     *  @since Release 20101201
9741     *
9742     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9743     */
9744     public static double jauGmst06(double uta, double utb, double tta, double ttb)
9745     {
9746        double t, gmst;
9747 
9748 
9749     /* TT Julian centuries since J2000.0. */
9750        t = ((tta - DJ00) + ttb) / DJC;
9751 
9752     /* Greenwich mean sidereal time, IAU 2006. */
9753        gmst = jauAnp(jauEra00(uta, utb) +
9754                       (    0.014506     +
9755                       (  4612.156534    +
9756                       (     1.3915817   +
9757                       (    -0.00000044  +
9758                       (    -0.000029956 +
9759                       (    -0.0000000368 )
9760               * t) * t) * t) * t) * t) * DAS2R);
9761 
9762        return gmst;
9763 
9764         }
9765     
9766 
9767     /**
9768     *  Universal Time to Greenwich mean sidereal time (IAU 1982 model).
9769     *
9770     *<p>This function is derived from the International Astronomical Union's
9771     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9772     *
9773     *<p>Status:  canonical model.
9774     *
9775     *<!-- Given: -->
9776     *     @param dj1 double     UT1 Julian Date (see note)
9777     *     @param dj2 double     UT1 Julian Date (see note) 
9778     *
9779     * <!-- Returned (function value): -->
9780     *  @return double    Greenwich mean sidereal time (radians)
9781     *
9782     * <p>Notes:
9783     * <ol>
9784     *
9785     * <li> The UT1 date dj1+dj2 is a Julian Date, apportioned in any
9786     *     convenient way between the arguments dj1 and dj2.  For example,
9787     *     JD(UT1)=2450123.7 could be expressed in any of these ways,
9788     *     among others:
9789     *<pre>
9790     *             dj1            dj2
9791     *
9792     *         2450123.7D0        0D0        (JD method)
9793     *          2451545D0      -1421.3D0     (J2000 method)
9794     *         2400000.5D0     50123.2D0     (MJD method)
9795     *         2450123.5D0       0.2D0       (date &amp; time method)
9796     *</pre>
9797     *     The JD method is the most natural and convenient to use in
9798     *     cases where the loss of several decimal digits of resolution
9799     *     is acceptable.  The J2000 and MJD methods are good compromises
9800     *     between resolution and convenience.  The date &amp; time method is
9801     *     best matched to the algorithm used:  maximum accuracy (or, at
9802     *     least, minimum noise) is delivered when the dj1 argument is for
9803     *     0hrs UT1 on the day in question and the dj2 argument lies in the
9804     *     range 0 to 1, or vice versa.
9805     *
9806     * <li> The algorithm is based on the IAU 1982 expression.  This is
9807     *     always described as giving the GMST at 0 hours UT1.  In fact, it
9808     *     gives the difference between the GMST and the UT, the steady
9809     *     4-minutes-per-day drawing-ahead of ST with respect to UT.  When
9810     *     whole days are ignored, the expression happens to equal the GMST
9811     *     at 0 hours UT1 each day.
9812     *
9813     * <li> In this function, the entire UT1 (the sum of the two arguments
9814     *     dj1 and dj2) is used directly as the argument for the standard
9815     *     formula, the constant term of which is adjusted by 12 hours to
9816     *     take account of the noon phasing of Julian Date.  The UT1 is then
9817     *     added, but omitting whole days to conserve accuracy.
9818     *</ol>
9819     *<p>Called:<ul>
9820     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9821     * </ul>
9822     *<p>References:
9823     *
9824     *     <p>Transactions of the International Astronomical Union,
9825     *     XVIII B, 67 (1983).
9826     *
9827     *     <p>Aoki et al., Astron. Astrophys. 105, 359-361 (1982).
9828     *
9829     *@version 2008 May 24
9830     *
9831     *  @since Release 20101201
9832     *
9833     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9834     */
9835     public static double jauGmst82(double dj1, double dj2)
9836     {
9837     /* Coefficients of IAU 1982 GMST-UT1 model */
9838        double A = 24110.54841  -  DAYSEC / 2.0;
9839        double B = 8640184.812866;
9840        double C = 0.093104;
9841        double D =  -6.2e-6;
9842 
9843     /* Note: the first constant, A, has to be adjusted by 12 hours */
9844     /* because the UT1 is supplied as a Julian date, which begins  */
9845     /* at noon.                                                    */
9846 
9847        double d1, d2, t, f, gmst;
9848 
9849 
9850     /* Julian centuries since fundamental epoch. */
9851        if (dj1 < dj2) {
9852           d1 = dj1;
9853           d2 = dj2;
9854        } else {
9855           d1 = dj2;
9856           d2 = dj1;
9857        }
9858        t = (d1 + (d2 - DJ00)) / DJC;
9859 
9860     /* Fractional part of JD(UT1), in seconds. */
9861        f = DAYSEC * (fmod(d1, 1.0) + fmod(d2, 1.0));
9862 
9863     /* GMST at this UT1. */
9864        gmst = jauAnp(DS2R * ((A + (B + (C + D * t) * t) * t) + f));
9865 
9866        return gmst;
9867 
9868         }
9869     
9870 
9871     /**
9872     *  Greenwich apparent sidereal time (consistent with IAU 2000
9873     *  resolutions).
9874     *
9875     *<p>This function is derived from the International Astronomical Union's
9876     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9877     *
9878     *<p>Status:  canonical model.
9879     *
9880     *<!-- Given: -->
9881     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9882     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9883     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
9884     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
9885     *
9886     * <!-- Returned (function value): -->
9887     *  @return double    Greenwich apparent sidereal time (radians)
9888     *
9889     * <p>Notes:
9890     * <ol>
9891     *
9892     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
9893     *     Julian Dates, apportioned in any convenient way between the
9894     *     argument pairs.  For example, JD=2450123.7 could be expressed in
9895     *     any of these ways, among others:
9896     *<pre>
9897     *            Part A        Part B
9898     *
9899     *         2450123.7           0.0       (JD method)
9900     *         2451545.0       -1421.3       (J2000 method)
9901     *         2400000.5       50123.2       (MJD method)
9902     *         2450123.5           0.2       (date &amp; time method)
9903     *</pre>
9904     *     The JD method is the most natural and convenient to use in
9905     *     cases where the loss of several decimal digits of resolution
9906     *     is acceptable (in the case of UT;  the TT is not at all critical
9907     *     in this respect).  The J2000 and MJD methods are good compromises
9908     *     between resolution and convenience.  For UT, the date &amp; time
9909     *     method is best matched to the algorithm that is used by the Earth
9910     *     Rotation Angle function, called internally:  maximum precision is
9911     *     delivered when the uta argument is for 0hrs UT1 on the day in
9912     *     question and the utb argument lies in the range 0 to 1, or vice
9913     *     versa.
9914     *
9915     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
9916     *     and TT to predict the effects of precession-nutation.  If UT1 is
9917     *     used for both purposes, errors of order 100 microarcseconds
9918     *     result.
9919     *
9920     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
9921     *     used only in conjunction with other IAU 2000 compatible
9922     *     components such as precession-nutation.
9923     *
9924     * <li> The result is returned in the range 0 to 2pi.
9925     *
9926     * <li> The algorithm is from Capitaine et al. (2003) and IERS
9927     *     Conventions 2003.
9928     *</ol>
9929     *<p>Called:<ul>
9930     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
9931     *     <li>{@link #jauEe00a} equation of the equinoxes, IAU 2000A
9932     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
9933     * </ul>
9934     *<p>References:
9935     *
9936     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
9937     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
9938     *     Astrophysics, 406, 1135-1149 (2003)
9939     *
9940     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
9941     *     IERS Technical Note No. 32, BKG (2004)
9942     *
9943     *@version 2008 May 16
9944     *
9945     *  @since Release 20101201
9946     *
9947     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
9948     */
9949     public static double jauGst00a(double uta, double utb, double tta, double ttb)
9950     {
9951        double gmst00, ee00a, gst;
9952 
9953 
9954        gmst00 = jauGmst00(uta, utb, tta, ttb);
9955        ee00a = jauEe00a(tta, ttb);
9956        gst = jauAnp(gmst00 + ee00a);
9957 
9958        return gst;
9959 
9960         }
9961     
9962 
9963     /**
9964     *  Greenwich apparent sidereal time (consistent with IAU 2000
9965     *  resolutions but using the truncated nutation model IAU 2000B).
9966     *
9967     *<p>This function is derived from the International Astronomical Union's
9968     *  SOFA (Standards Of Fundamental Astronomy) software collection.
9969     *
9970     *<p>Status:  support function.
9971     *
9972     *<!-- Given: -->
9973     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
9974     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
9975     *
9976     * <!-- Returned (function value): -->
9977     *  @return double    Greenwich apparent sidereal time (radians)
9978     *
9979     * <p>Notes:
9980     * <ol>
9981     *
9982     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
9983     *     convenient way between the argument pair.  For example,
9984     *     JD=2450123.7 could be expressed in any of these ways, among
9985     *     others:
9986     *<pre>
9987     *             uta            utb
9988     *
9989     *         2450123.7           0.0       (JD method)
9990     *         2451545.0       -1421.3       (J2000 method)
9991     *         2400000.5       50123.2       (MJD method)
9992     *         2450123.5           0.2       (date &amp; time method)
9993     *</pre>
9994     *     The JD method is the most natural and convenient to use in cases
9995     *     where the loss of several decimal digits of resolution is
9996     *     acceptable.  The J2000 and MJD methods are good compromises
9997     *     between resolution and convenience.  For UT, the date &amp; time
9998     *     method is best matched to the algorithm that is used by the Earth
9999     *     Rotation Angle function, called internally:  maximum precision is
10000     *     delivered when the uta argument is for 0hrs UT1 on the day in
10001     *     question and the utb argument lies in the range 0 to 1, or vice
10002     *     versa.
10003     *
10004     * <li> The result is compatible with the IAU 2000 resolutions, except
10005     *     that accuracy has been compromised for the sake of speed and
10006     *     convenience in two respects:
10007     *
10008     *     . UT is used instead of TDB (or TT) to compute the precession
10009     *       component of GMST and the equation of the equinoxes.  This
10010     *       results in errors of order 0.1 mas at present.
10011     *
10012     *     . The IAU 2000B abridged nutation model (McCarthy &amp; Luzum, 2001)
10013     *       is used, introducing errors of up to 1 mas.
10014     *
10015     * <li> This GAST is compatible with the IAU 2000 resolutions and must be
10016     *     used only in conjunction with other IAU 2000 compatible
10017     *     components such as precession-nutation.
10018     *
10019     * <li> The result is returned in the range 0 to 2pi.
10020     *
10021     * <li> The algorithm is from Capitaine et al. (2003) and IERS
10022     *     Conventions 2003.
10023     *</ol>
10024     *<p>Called:<ul>
10025     *     <li>{@link #jauGmst00} Greenwich mean sidereal time, IAU 2000
10026     *     <li>{@link #jauEe00b} equation of the equinoxes, IAU 2000B
10027     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10028     * </ul>
10029     *<p>References:
10030     *
10031     *    <p>Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
10032     *     implement the IAU 2000 definition of UT1", Astronomy &amp;
10033     *     Astrophysics, 406, 1135-1149 (2003)
10034     *
10035     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
10036     *     precession-nutation of the celestial pole", Celestial Mechanics &amp;
10037     *     Dynamical Astronomy, 85, 37-49 (2003)
10038     *
10039     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
10040     *     IERS Technical Note No. 32, BKG (2004)
10041     *
10042     *@version 2008 May 16
10043     *
10044     *  @since Release 20101201
10045     *
10046     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10047     */
10048     public static double jauGst00b(double uta, double utb)
10049     {
10050        double gmst00, ee00b, gst;
10051 
10052 
10053        gmst00 = jauGmst00(uta, utb, uta, utb);
10054        ee00b = jauEe00b(uta, utb);
10055        gst = jauAnp(gmst00 + ee00b);
10056 
10057        return gst;
10058 
10059         }
10060     
10061 
10062     /**
10063     *  Greenwich apparent sidereal time, IAU 2006, given the NPB matrix.
10064     *
10065     *<p>This function is derived from the International Astronomical Union's
10066     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10067     *
10068     *<p>Status:  support function.
10069     *
10070     *<!-- Given: -->
10071     *     @param uta double         UT1 as a 2-part Julian Date (Notes 1,2)
10072     *     @param utb double         UT1 as a 2-part Julian Date (Notes 1,2) 
10073     *     @param tta double         TT as a 2-part Julian Date (Notes 1,2)
10074     *     @param ttb double         TT as a 2-part Julian Date (Notes 1,2) 
10075     *     @param rnpb      double[3][3]   nutation x precession x bias matrix
10076     *
10077     * <!-- Returned (function value): -->
10078     *  @return double        Greenwich apparent sidereal time (radians)
10079     *
10080     * <p>Notes:
10081     * <ol>
10082     *
10083     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10084     *     Julian Dates, apportioned in any convenient way between the
10085     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10086     *     any of these ways, among others:
10087     *<pre>
10088     *            Part A        Part B
10089     *
10090     *         2450123.7           0.0       (JD method)
10091     *         2451545.0       -1421.3       (J2000 method)
10092     *         2400000.5       50123.2       (MJD method)
10093     *         2450123.5           0.2       (date &amp; time method)
10094     *</pre>
10095     *     The JD method is the most natural and convenient to use in
10096     *     cases where the loss of several decimal digits of resolution
10097     *     is acceptable (in the case of UT;  the TT is not at all critical
10098     *     in this respect).  The J2000 and MJD methods are good compromises
10099     *     between resolution and convenience.  For UT, the date &amp; time
10100     *     method is best matched to the algorithm that is used by the Earth
10101     *     rotation angle function, called internally:  maximum precision is
10102     *     delivered when the uta argument is for 0hrs UT1 on the day in
10103     *     question and the utb argument lies in the range 0 to 1, or vice
10104     *     versa.
10105     *
10106     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10107     *     and TT to predict the effects of precession-nutation.  If UT1 is
10108     *     used for both purposes, errors of order 100 microarcseconds
10109     *     result.
10110     *
10111     * <li> Although the function uses the IAU 2006 series for s+XY/2, it is
10112     *     otherwise independent of the precession-nutation model and can in
10113     *     practice be used with any equinox-based NPB matrix.
10114     *
10115     * <li> The result is returned in the range 0 to 2pi.
10116     *</ol>
10117     *<p>Called:<ul>
10118     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
10119     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
10120     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10121     *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
10122     *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
10123     * </ul>
10124     *<p>Reference:
10125     *
10126     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10127     *
10128     *@version 2008 May 24
10129     *
10130     *  @since Release 20101201
10131     *
10132     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10133     */
10134     public static double jauGst06(double uta, double utb, double tta, double ttb,
10135                     double rnpb[][])
10136     {
10137        double s, era, eors, gst;
10138 
10139 
10140     /* Extract CIP coordinates. */
10141        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
10142 
10143     /* The CIO locator, s. */
10144        s = jauS06(tta, ttb, cip.x, cip.y);
10145 
10146     /* Greenwich apparent sidereal time. */
10147        era = jauEra00(uta, utb);
10148        eors = jauEors(rnpb, s);
10149        gst = jauAnp(era - eors);
10150 
10151        return gst;
10152 
10153         }
10154     
10155 
10156     /**
10157     *  Greenwich apparent sidereal time (consistent with IAU 2000 and 2006
10158     *  resolutions).
10159     *
10160     *<p>This function is derived from the International Astronomical Union's
10161     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10162     *
10163     *<p>Status:  canonical model.
10164     *
10165     *<!-- Given: -->
10166     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10167     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10168     *     @param tta double     TT as a 2-part Julian Date (Notes 1,2)
10169     *     @param ttb double     TT as a 2-part Julian Date (Notes 1,2) 
10170     *
10171     * <!-- Returned (function value): -->
10172     *  @return double    Greenwich apparent sidereal time (radians)
10173     *
10174     * <p>Notes:
10175     * <ol>
10176     *
10177     * <li> The UT1 and TT dates uta+utb and tta+ttb respectively, are both
10178     *     Julian Dates, apportioned in any convenient way between the
10179     *     argument pairs.  For example, JD=2450123.7 could be expressed in
10180     *     any of these ways, among others:
10181     *<pre>
10182     *            Part A        Part B
10183     *
10184     *         2450123.7           0.0       (JD method)
10185     *         2451545.0       -1421.3       (J2000 method)
10186     *         2400000.5       50123.2       (MJD method)
10187     *         2450123.5           0.2       (date &amp; time method)
10188     *</pre>
10189     *     The JD method is the most natural and convenient to use in
10190     *     cases where the loss of several decimal digits of resolution
10191     *     is acceptable (in the case of UT;  the TT is not at all critical
10192     *     in this respect).  The J2000 and MJD methods are good compromises
10193     *     between resolution and convenience.  For UT, the date &amp; time
10194     *     method is best matched to the algorithm that is used by the Earth
10195     *     rotation angle function, called internally:  maximum precision is
10196     *     delivered when the uta argument is for 0hrs UT1 on the day in
10197     *     question and the utb argument lies in the range 0 to 1, or vice
10198     *     versa.
10199     *
10200     * <li> Both UT1 and TT are required, UT1 to predict the Earth rotation
10201     *     and TT to predict the effects of precession-nutation.  If UT1 is
10202     *     used for both purposes, errors of order 100 microarcseconds
10203     *     result.
10204     *
10205     * <li> This GAST is compatible with the IAU 2000/2006 resolutions and
10206     *     must be used only in conjunction with IAU 2006 precession and
10207     *     IAU 2000A nutation.
10208     *
10209     * <li> The result is returned in the range 0 to 2pi.
10210     *</ol>
10211     *<p>Called:<ul>
10212     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
10213     *     <li>{@link #jauGst06} Greenwich apparent ST, IAU 2006, given NPB matrix
10214     * </ul>
10215     *<p>Reference:
10216     *
10217     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
10218     *
10219     *@version 2008 May 16
10220     *
10221     *  @since Release 20101201
10222     *
10223     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10224     */
10225     public static double jauGst06a(double uta, double utb, double tta, double ttb)
10226     {
10227        double rnpb[][] = new double[3][3], gst;
10228 
10229 
10230     /* Classical nutation x precession x bias matrix, IAU 2000A. */
10231        rnpb = jauPnm06a(tta, ttb);
10232 
10233     /* Greenwich apparent sidereal time. */
10234        gst = jauGst06(uta, utb, tta, ttb, rnpb);
10235 
10236        return gst;
10237 
10238         }
10239     
10240 
10241     /**
10242     *  Greenwich apparent sidereal time (consistent with IAU 1982/94
10243     *  resolutions).
10244     *
10245     *<p>This function is derived from the International Astronomical Union's
10246     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10247     *
10248     *<p>Status:  support function.
10249     *
10250     *<!-- Given: -->
10251     *     @param uta double     UT1 as a 2-part Julian Date (Notes 1,2)
10252     *     @param utb double     UT1 as a 2-part Julian Date (Notes 1,2) 
10253     *
10254     * <!-- Returned (function value): -->
10255     *  @return double    Greenwich apparent sidereal time (radians)
10256     *
10257     * <p>Notes:
10258     * <ol>
10259     *
10260     * <li> The UT1 date uta+utb is a Julian Date, apportioned in any
10261     *     convenient way between the argument pair.  For example,
10262     *     JD=2450123.7 could be expressed in any of these ways, among
10263     *     others:
10264     *<pre>
10265     *             uta            utb
10266     *
10267     *         2450123.7           0.0       (JD method)
10268     *         2451545.0       -1421.3       (J2000 method)
10269     *         2400000.5       50123.2       (MJD method)
10270     *         2450123.5           0.2       (date &amp; time method)
10271     *</pre>
10272     *     The JD method is the most natural and convenient to use in cases
10273     *     where the loss of several decimal digits of resolution is
10274     *     acceptable.  The J2000 and MJD methods are good compromises
10275     *     between resolution and convenience.  For UT, the date &amp; time
10276     *     method is best matched to the algorithm that is used by the Earth
10277     *     Rotation Angle function, called internally:  maximum precision is
10278     *     delivered when the uta argument is for 0hrs UT1 on the day in
10279     *     question and the utb argument lies in the range 0 to 1, or vice
10280     *     versa.
10281     *
10282     * <li> The result is compatible with the IAU 1982 and 1994 resolutions,
10283     *     except that accuracy has been compromised for the sake of
10284     *     convenience in that UT is used instead of TDB (or TT) to compute
10285     *     the equation of the equinoxes.
10286     *
10287     * <li> This GAST must be used only in conjunction with contemporaneous
10288     *     IAU standards such as 1976 precession, 1980 obliquity and 1982
10289     *     nutation.  It is not compatible with the IAU 2000 resolutions.
10290     *
10291     * <li> The result is returned in the range 0 to 2pi.
10292     *</ol>
10293     *<p>Called:<ul>
10294     *     <li>{@link #jauGmst82} Greenwich mean sidereal time, IAU 1982
10295     *     <li>{@link #jauEqeq94} equation of the equinoxes, IAU 1994
10296     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10297     * </ul>
10298     *<p>References:
10299     *
10300     *     <p>Explanatory Supplement to the Astronomical Almanac,
10301     *     P. Kenneth Seidelmann (ed), University Science Books (1992)
10302     *
10303     *     IAU Resolution C7, Recommendation 3 (1994)
10304     *
10305     *@version 2008 May 16
10306     *
10307     *  @since Release 20101201
10308     *
10309     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10310     */
10311     public static double jauGst94(double uta, double utb)
10312     {
10313        double gmst82, eqeq94, gst;
10314 
10315 
10316        gmst82 = jauGmst82(uta, utb);
10317        eqeq94 = jauEqeq94(uta, utb);
10318        gst = jauAnp(gmst82  + eqeq94);
10319 
10320        return gst;
10321 
10322         }
10323     
10324 
10325     /**
10326     *  Transform Hipparcos star data into the FK5 (J2000.0) system.
10327     *
10328     *<p>This function is derived from the International Astronomical Union's
10329     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10330     *
10331     *<p>Status:  support function.
10332     *
10333     *  Given (all Hipparcos, epoch J2000.0):
10334     *    @param rh      double    RA (radians)
10335     *    @param dh      double    Dec (radians)
10336     *    @param drh     double    proper motion in RA (dRA/dt, rad/Jyear)
10337     *    @param ddh     double    proper motion in Dec (dDec/dt, rad/Jyear)
10338     *    @param pxh     double    parallax (arcsec)
10339     *    @param rvh     double    radial velocity (km/s, positive = receding)
10340     *
10341     *  Returned (all FK5, equinox J2000.0, epoch J2000.0):
10342     *     r5      double    RA (radians)
10343     *     d5      double    Dec (radians)
10344     *     dr5     double    proper motion in RA (dRA/dt, rad/Jyear)
10345     *     dd5     double    proper motion in Dec (dDec/dt, rad/Jyear)
10346     *     px5     double    parallax (arcsec)
10347     *     rv5     double    radial velocity (km/s, positive = receding)
10348     *
10349     * <p>Notes:
10350     * <ol>
10351     *
10352     * <li> This function transforms Hipparcos star positions and proper
10353     *     motions into FK5 J2000.0.
10354     *
10355     * <li> The proper motions in RA are dRA/dt rather than
10356     *     cos(Dec)*dRA/dt, and are per year rather than per century.
10357     *
10358     * <li> The FK5 to Hipparcos transformation is modeled as a pure
10359     *     rotation and spin;  zonal errors in the FK5 catalog are not
10360     *     taken into account.
10361     *
10362     * <li> See also jauFk52h, jauFk5hz, jauHfk5z.
10363     *</ol>
10364     *<p>Called:<ul>
10365     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
10366     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10367     *     <li>{@link #jauRv2m} r-vector to r-matrix
10368     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10369     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10370     *     <li>{@link #jauPxp} vector product of two p-vectors
10371     *     <li>{@link #jauPmp} p-vector minus p-vector
10372     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
10373     * </ul>
10374     *<p>Reference:
10375     *
10376     *     <p>F.Mignard &amp; M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
10377     *
10378     *@version 2009 December 17
10379     *
10380     *  @since Release 20101201
10381     *
10382     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10383     */
10384     public static CatalogCoords jauH2fk5(double rh, double dh,
10385                   double drh, double ddh, double pxh, double rvh)
10386     {
10387        int i;
10388        double pvh[][] = new double[2][3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], wxp[] = new double[3], vv[] = new double[3], pv5[][] = new double[2][3];
10389 
10390 
10391     /* Hipparcos barycentric position/velocity pv-vector (normalized). */
10392        jauStarpv(rh, dh, drh, ddh, pxh, rvh, pvh);
10393 
10394     /* FK5 to Hipparcos orientation matrix and spin vector. */
10395        jauFk5hip(r5h, s5h);
10396 
10397     /* Make spin units per day instead of per year. */
10398        for ( i = 0; i < 3; s5h[i++] /= 365.25 );
10399 
10400     /* Orient the spin into the Hipparcos system. */
10401        sh = jauRxp(r5h, s5h);
10402 
10403     /* De-orient the Hipparcos position into the FK5 system. */
10404        pv5[0] = jauTrxp(r5h, pvh[0]);
10405 
10406     /* Apply spin to the position giving an extra space motion component. */
10407        wxp = jauPxp(pvh[0],sh);
10408 
10409     /* Subtract this component from the Hipparcos space motion. */
10410        vv = jauPmp(pvh[1], wxp);
10411 
10412     /* De-orient the Hipparcos space motion into the FK5 system. */
10413        pv5[1] = jauTrxp(r5h, vv);
10414 
10415     /* FK5 pv-vector to spherical., r5, d5, dr5, dd5, px5, rv5 */
10416        CatalogCoords cat = null;
10417        try {
10418            cat = jauPvstar(pv5);
10419        } catch (JSOFAInternalError e) {
10420            // original code just ignored this possibility
10421            e.printStackTrace();
10422        }
10423 
10424        return cat;
10425 
10426         }
10427     
10428 
10429     /**
10430     *  Transform a Hipparcos star position into FK5 J2000.0, assuming
10431     *  zero Hipparcos proper motion.
10432     *
10433     *<p>This function is derived from the International Astronomical Union's
10434     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10435     *
10436     *<p>Status:  support function.
10437     *
10438     *<!-- Given: -->
10439     *     @param rh             double     Hipparcos RA (radians)
10440     *     @param dh             double     Hipparcos Dec (radians)
10441     *     @param date1 double     TDB date (Note 1)
10442     *     @param date2 double     TDB date (Note 1) 
10443     *
10444     * FIXME original did not return the parallax and radial velocity of the CatalogCoords type.
10445     *  Returned (all FK5, equinox J2000.0, date date1+date2):
10446     *     r5            double    RA (radians)
10447     *     d5            double    Dec (radians)
10448     *     dr5           double    FK5 RA proper motion (rad/year, Note 4)
10449     *     dd5           double    Dec proper motion (rad/year, Note 4)
10450     *
10451     * <p>Notes:
10452     * <ol>
10453     *
10454     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10455     *     convenient way between the two arguments.  For example,
10456     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10457     *     among others:
10458     *<pre>
10459     *            date1          date2
10460     *
10461     *         2450123.7           0.0       (JD method)
10462     *         2451545.0       -1421.3       (J2000 method)
10463     *         2400000.5       50123.2       (MJD method)
10464     *         2450123.5           0.2       (date &amp; time method)
10465     *</pre>
10466     *     The JD method is the most natural and convenient to use in
10467     *     cases where the loss of several decimal digits of resolution
10468     *     is acceptable.  The J2000 method is best matched to the way
10469     *     the argument is handled internally and will deliver the
10470     *     optimum resolution.  The MJD method and the date &amp; time methods
10471     *     are both good compromises between resolution and convenience.
10472     *
10473     * <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
10474     *
10475     * <li> The FK5 to Hipparcos transformation is modeled as a pure rotation
10476     *     and spin;  zonal errors in the FK5 catalogue are not taken into
10477     *     account.
10478     *
10479     * <li> It was the intention that Hipparcos should be a close
10480     *     approximation to an inertial frame, so that distant objects have
10481     *     zero proper motion;  such objects have (in general) non-zero
10482     *     proper motion in FK5, and this function returns those fictitious
10483     *     proper motions.
10484     *
10485     * <li> The position returned by this function is in the FK5 J2000.0
10486     *     reference system but at date date1+date2.
10487     *
10488     * <li> See also jauFk52h, jauH2fk5, jauFk5zhz.
10489     *</ol>
10490     *<p>Called:<ul>
10491     *     <li>{@link #jauS2c} spherical coordinates to unit vector
10492     *     <li>{@link #jauFk5hip} FK5 to Hipparcos rotation and spin
10493     *     <li>{@link #jauRxp} product of r-matrix and p-vector
10494     *     <li>{@link #jauSxp} multiply p-vector by scalar
10495     *     <li>{@link #jauRxr} product of two r-matrices
10496     *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
10497     *     <li>{@link #jauPxp} vector product of two p-vectors
10498     *     <li>{@link #jauPv2s} pv-vector to spherical
10499     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
10500     * </ul>
10501     *<p>Reference:
10502     *
10503     *     <p>F.Mignard &amp; M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
10504     *
10505     *@version 2009 December 17
10506     *
10507     *  @since Release 20101201
10508     *
10509     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10510     *
10511     */
10512     public static CatalogCoords jauHfk5z(double rh, double dh, double date1, double date2)
10513     {
10514        double t, ph[] = new double[3], r5h[][] = new double[3][3], s5h[] = new double[3], sh[] = new double[3], vst[] = new double[3],
10515        rst[][] = new double[3][3], r5ht[][] = new double[3][3], pv5e[][] = new double[2][3], vv[] = new double[3];
10516 
10517 
10518     /* Time interval from fundamental epoch J2000.0 to given date (JY). */
10519        t = ((date1 - DJ00) + date2) / DJY;
10520 
10521     /* Hipparcos barycentric position vector (normalized). */
10522        ph = jauS2c(rh,dh);
10523 
10524     /* FK5 to Hipparcos orientation matrix and spin vector. */
10525        jauFk5hip(r5h, s5h);
10526 
10527     /* Rotate the spin into the Hipparcos system. */
10528        sh = jauRxp(r5h, s5h);
10529 
10530     /* Accumulated Hipparcos wrt FK5 spin over that interval. */
10531        vst = jauSxp(t,s5h);
10532 
10533     /* Express the accumulated spin as a rotation matrix. */
10534        rst = jauRv2m(vst);
10535 
10536     /* Rotation matrix:  accumulated spin, then FK5 to Hipparcos. */
10537        r5ht = jauRxr(r5h, rst);
10538 
10539     /* De-orient &amp; de-spin the Hipparcos position into FK5 J2000.0. */
10540        pv5e[0] = jauTrxp(r5ht, ph);
10541 
10542     /* Apply spin to the position giving a space motion. */
10543        vv = jauPxp(sh,ph);
10544 
10545     /* De-orient &amp; de-spin the Hipparcos space motion into FK5 J2000.0. */
10546        pv5e[1] = jauTrxp(r5ht, vv);
10547 
10548     /* FK5 position/velocity pv-vector to spherical. */
10549        SphericalPositionVelocity pvs = jauPv2s(pv5e);
10550        double r5 = jauAnp(pvs.pos.theta);
10551 
10552        return new CatalogCoords(r5, pvs.pos.phi, pvs.vel.theta, pvs.vel.phi, 0.0, 0.0);
10553 
10554         }
10555     
10556 
10557     /**
10558     *  Initialize an r-matrix to the identity matrix.
10559     *
10560     *<p>This function is derived from the International Astronomical Union's
10561     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10562     *
10563     *<p>Status:  vector/matrix support function.
10564     *
10565     *<!-- Returned: -->
10566     *     @param r        double[3][3]      <u>returned</u> r-matrix
10567     *
10568     *<p>Called:<ul>
10569     *     <li>{@link #jauZr} zero r-matrix
10570     * </ul>
10571     *@version 2008 May 11
10572     *
10573     *  @since Release 20101201
10574     *
10575     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10576     */
10577     public static void jauIr(double r[][])
10578     {
10579        jauZr(r);
10580        r[0][0] = 1.0;
10581        r[1][1] = 1.0;
10582        r[2][2] = 1.0;
10583 
10584        return;
10585 
10586         }
10587     
10588 
10589     /**
10590     *  Julian Date to Gregorian year, month, day, and fraction of a day.
10591     *
10592     *<p>This function is derived from the International Astronomical Union's
10593     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10594     *
10595     *<p>Status:  support function.
10596     *
10597     *<!-- Given: -->
10598     *     @param dj1 double    Julian Date (Notes 1, 2)
10599     *     @param dj2 double    Julian Date (Notes 1, 2) 
10600     *
10601     *  Returned (arguments):
10602     *     iy        int      year
10603     *     im        int      month
10604     *     id        int      day
10605     *     fd        double   fraction of day
10606     *
10607     * <!-- Returned (function value): -->
10608     *  @return int      status:
10609     *                           0 = OK
10610     *                          -1 = unacceptable date (Note 3)
10611     *
10612     * <p>Notes:
10613     * <ol>
10614     *
10615     * <li> The earliest valid date is -68569.5 (-4900 March 1).  The
10616     *     largest value accepted is 10^9.
10617     *
10618     * <li> The Julian Date is apportioned in any convenient way between
10619     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10620     *     be expressed in any of these ways, among others:
10621     *<pre>
10622     *            dj1             dj2
10623     *
10624     *         2450123.7           0.0       (JD method)
10625     *         2451545.0       -1421.3       (J2000 method)
10626     *         2400000.5       50123.2       (MJD method)
10627     *         2450123.5           0.2       (date &amp; time method)
10628     *</pre>
10629     * <li> In early eras the conversion is from the "proleptic Gregorian
10630     *     calendar";  no account is taken of the date(s) of adoption of
10631     *     the Gregorian calendar, nor is the AD/BC numbering convention
10632     *     observed.
10633     *</ol>
10634     *<p>Reference:
10635     *
10636     *     <p>Explanatory Supplement to the Astronomical Almanac,
10637     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10638     *     Section 12.92 (p604).
10639     *
10640     *@version 2008 May 26
10641     *
10642     *  @since Release 20101201
10643     *
10644     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10645     */
10646     public static Calendar jauJd2cal(double dj1, double dj2) throws JSOFAIllegalParameter
10647     {
10648     /* Minimum and maximum allowed JD */
10649        final double djmin = -68569.5;
10650        final double djmax = 1e9;
10651 
10652        long jd, l, n, i, k;
10653        double dj, d1, d2, f1, f2, f, d;
10654 
10655 
10656     /* Verify date is acceptable. */
10657        dj = dj1 + dj2;
10658        if (dj < djmin || dj > djmax) throw new JSOFAIllegalParameter("input julian date out of range", -1);
10659 
10660     /* Copy the date, big then small, and re-align to midnight. */
10661        if (dj1 >= dj2) {
10662           d1 = dj1;
10663           d2 = dj2;
10664        } else {
10665           d1 = dj2;
10666           d2 = dj1;
10667        }
10668        d2 -= 0.5;
10669 
10670     /* Separate day and fraction. */
10671        f1 = fmod(d1, 1.0);
10672        f2 = fmod(d2, 1.0);
10673        f = fmod(f1 + f2, 1.0);
10674        if (f < 0.0) f += 1.0;
10675        d = floor(d1 - f1) + floor(d2 - f2) + floor(f1 + f2 - f);
10676        jd = (long) floor(d) + 1L;
10677 
10678     /* Express day in Gregorian calendar. */
10679        l = jd + 68569L;
10680        n = (4L * l) / 146097L;
10681        l -= (146097L * n + 3L) / 4L;
10682        i = (4000L * (l + 1L)) / 1461001L;
10683        l -= (1461L * i) / 4L - 31L;
10684        k = (80L * l) / 2447L;
10685        int id = (int) (l - (2447L * k) / 80L);
10686        l = k / 11L;
10687        int im = (int) (k + 2L - 12L * l);
10688        int iy = (int) (100L * (n - 49L) + i + l);
10689       
10690 
10691        return new Calendar(iy, im, id, f);
10692 
10693         }
10694      
10695     /**
10696     *  Julian Date to Gregorian Calendar, expressed in a form convenient
10697     *  for formatting messages:  rounded to a specified precision.
10698     *
10699     *<p>This function is derived from the International Astronomical Union's
10700     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10701     *
10702     *<p>Status:  support function.
10703     *
10704     *<!-- Given: -->
10705     *     @param ndp        int       number of decimal places of days in fraction
10706     *     @param dj1 double    dj1+dj2 = Julian Date (Note 1)
10707     *     @param dj2 double    dj1+dj2 = Julian Date (Note 1) 
10708     *
10709     *<!-- Returned: -->
10710     *     @param iymdf      int[4]     <u>returned</u> year, month, day, fraction in Gregorian calendar
10711     *
10712     *
10713     * <!-- Returned (function value): -->
10714     *  @return int      status:
10715     *                          -1 = date out of range
10716     *                           0 = OK
10717     *                          +1 = NDP not 0-9 (interpreted as 0)
10718     *
10719     * <p>Notes:
10720     * <ol>
10721     *
10722     * <li> The Julian Date is apportioned in any convenient way between
10723     *     the arguments dj1 and dj2.  For example, JD=2450123.7 could
10724     *     be expressed in any of these ways, among others:
10725     *<pre>
10726     *             dj1            dj2
10727     *
10728     *         2450123.7           0.0       (JD method)
10729     *         2451545.0       -1421.3       (J2000 method)
10730     *         2400000.5       50123.2       (MJD method)
10731     *         2450123.5           0.2       (date &amp; time method)
10732     *</pre>
10733     * <li> In early eras the conversion is from the "Proleptic Gregorian
10734     *     Calendar";  no account is taken of the date(s) of adoption of
10735     *     the Gregorian Calendar, nor is the AD/BC numbering convention
10736     *     observed.
10737     *
10738     * <li> Refer to the function jauJd2cal.
10739     *
10740     * <li> NDP should be 4 or less if internal overflows are to be
10741     *     avoided on machines which use 16-bit integers.
10742     *</ol>
10743     *<p>Called:<ul>
10744     *     <li>{@link #jauJd2cal} JD to Gregorian calendar
10745     * </ul>
10746     *<p>Reference:
10747     *
10748     *     <p>Explanatory Supplement to the Astronomical Almanac,
10749     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10750     *     Section 12.92 (p604).
10751     *
10752     *@version 2008 October 28
10753     *
10754     *  @since Release 20101201
10755     *
10756     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10757     */
10758     public static int jauJdcalf(int ndp, double dj1, double dj2, int iymdf[])
10759     {
10760        int j;
10761        double denom, d1, d2, f1, f2, f;
10762 
10763 
10764     /* Denominator of fraction (e.g. 100 for 2 decimal places). */
10765        if ((ndp >= 0) && (ndp <= 9)) {
10766           j = 0;
10767           denom = pow(10.0, ndp);
10768        } else {
10769           j = 1;
10770           denom = 1.0;
10771        }
10772 
10773     /* Copy the date, big then small, and realign to midnight. */
10774        if (dj1 >= dj2) {
10775           d1 = dj1;
10776           d2 = dj2;
10777        } else {
10778           d1 = dj2;
10779           d2 = dj1;
10780        }
10781        d2 -= 0.5;
10782 
10783     /* Separate days and fractions. */
10784        f1 = fmod(d1, 1.0);
10785        f2 = fmod(d2, 1.0);
10786        d1 = floor(d1 - f1);
10787        d2 = floor(d2 - f2);
10788 
10789     /* Round the total fraction to the specified number of places. */
10790        f = floor((f1 + f2) * denom) / denom;
10791 
10792     /* Re-assemble the rounded date and re-align to noon. */
10793        d2 += f + 0.5;
10794 
10795        /* Convert to Gregorian Calendar. */
10796        try {
10797            Calendar cal = jauJd2cal(d1, d2);
10798            iymdf[0] = cal.iy;
10799            iymdf[1] = cal.im;
10800            iymdf[2] = cal.id;
10801            iymdf[3] = (int) (cal.fd * denom);
10802        } catch (JSOFAIllegalParameter e) {
10803            j = -1;
10804        }
10805 
10806     /* Return the status. */
10807        return j;
10808 
10809         }
10810     
10811 
10812     /**
10813     *  Form the matrix of nutation for a given date, IAU 2000A model.
10814     *
10815     *<p>This function is derived from the International Astronomical Union's
10816     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10817     *
10818     *<p>Status:  support function.
10819     *
10820     *<!-- Given: -->
10821     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10822     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10823     *
10824     *<!-- Returned: -->
10825     *     @return rmatn         double[3][3]      <u>returned</u> nutation matrix
10826     *
10827     * <p>Notes:
10828     * <ol>
10829     *
10830     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10831     *     convenient way between the two arguments.  For example,
10832     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10833     *     among others:
10834     *<pre>
10835     *            date1          date2
10836     *
10837     *         2450123.7           0.0       (JD method)
10838     *         2451545.0       -1421.3       (J2000 method)
10839     *         2400000.5       50123.2       (MJD method)
10840     *         2450123.5           0.2       (date &amp; time method)
10841     *</pre>
10842     *     The JD method is the most natural and convenient to use in
10843     *     cases where the loss of several decimal digits of resolution
10844     *     is acceptable.  The J2000 method is best matched to the way
10845     *     the argument is handled internally and will deliver the
10846     *     optimum resolution.  The MJD method and the date &amp; time methods
10847     *     are both good compromises between resolution and convenience.
10848     *
10849     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10850     *     the p-vector V(true) is with respect to the true equatorial triad
10851     *     of date and the p-vector V(mean) is with respect to the mean
10852     *     equatorial triad of date.
10853     *
10854     * <li> A faster, but slightly less accurate result (about 1 mas), can be
10855     *     obtained by using instead the jauNum00b function.
10856     *</ol>
10857     *<p>Called:<ul>
10858     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
10859     * </ul>
10860     *<p>Reference:
10861     *
10862     *     <p>Explanatory Supplement to the Astronomical Almanac,
10863     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10864     *     Section 3.222-3 (p114).
10865     *
10866     *@version 2008 May 12
10867     *
10868     *  @since Release 20101201
10869     *
10870     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10871     */
10872     public static double[][] jauNum00a(double date1, double date2)
10873     {
10874 
10875     /* Obtain the required matrix (discarding other results). */
10876        PrecessionNutation pn = jauPn00a(date1, date2);
10877 
10878        return pn.rn ;
10879 
10880         }
10881     
10882 
10883     /**
10884     *  Form the matrix of nutation for a given date, IAU 2000B model.
10885     *
10886     *<p>This function is derived from the International Astronomical Union's
10887     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10888     *
10889     *<p>Status:  support function.
10890     *
10891     *<!-- Given: -->
10892     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10893     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10894     *
10895     *<!-- Returned: -->
10896     *     @return rmatn         double[3][3]     <u>returned</u> nutation matrix
10897     *
10898     * <p>Notes:
10899     * <ol>
10900     *
10901     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10902     *     convenient way between the two arguments.  For example,
10903     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10904     *     among others:
10905     *<pre>
10906     *            date1          date2
10907     *
10908     *         2450123.7           0.0       (JD method)
10909     *         2451545.0       -1421.3       (J2000 method)
10910     *         2400000.5       50123.2       (MJD method)
10911     *         2450123.5           0.2       (date &amp; time method)
10912     *</pre>
10913     *     The JD method is the most natural and convenient to use in
10914     *     cases where the loss of several decimal digits of resolution
10915     *     is acceptable.  The J2000 method is best matched to the way
10916     *     the argument is handled internally and will deliver the
10917     *     optimum resolution.  The MJD method and the date &amp; time methods
10918     *     are both good compromises between resolution and convenience.
10919     *
10920     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10921     *     the p-vector V(true) is with respect to the true equatorial triad
10922     *     of date and the p-vector V(mean) is with respect to the mean
10923     *     equatorial triad of date.
10924     *
10925     * <li> The present function is faster, but slightly less accurate (about
10926     *     1 mas), than the jauNum00a function.
10927     *</ol>
10928     *<p>Called:<ul>
10929     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
10930     * </ul>
10931     *<p>Reference:
10932     *
10933     *     <p>Explanatory Supplement to the Astronomical Almanac,
10934     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
10935     *     Section 3.222-3 (p114).
10936     *
10937     *@version 2008 May 12
10938     *
10939     *  @since Release 20101201
10940     *
10941     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
10942     */
10943     public static double[][] jauNum00b(double date1, double date2)
10944     {
10945 
10946     /* Obtain the required matrix (discarding other results). */
10947        PrecessionNutation pn = jauPn00b(date1, date2);
10948  
10949        return pn.rn;
10950 
10951     }
10952     
10953 
10954     /**
10955     *  Form the matrix of nutation for a given date, IAU 2006/2000A model.
10956     *
10957     *<p>This function is derived from the International Astronomical Union's
10958     *  SOFA (Standards Of Fundamental Astronomy) software collection.
10959     *
10960     *<p>Status:  support function.
10961     *
10962     *<!-- Given: -->
10963     *     @param date1 double TT as a 2-part Julian Date (Note 1)
10964     *     @param date2 double TT as a 2-part Julian Date (Note 1)
10965     *
10966     *<!-- Returned: -->
10967     *     @return rmatn          double[3][3]      <u>returned</u> nutation matrix
10968     *
10969     * <p>Notes:
10970     * <ol>
10971     *
10972     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
10973     *     convenient way between the two arguments.  For example,
10974     *     JD(TT)=2450123.7 could be expressed in any of these ways,
10975     *     among others:
10976     *<pre>
10977     *            date1          date2
10978     *
10979     *         2450123.7           0.0       (JD method)
10980     *         2451545.0       -1421.3       (J2000 method)
10981     *         2400000.5       50123.2       (MJD method)
10982     *         2450123.5           0.2       (date &amp; time method)
10983     *</pre>
10984     *     The JD method is the most natural and convenient to use in
10985     *     cases where the loss of several decimal digits of resolution
10986     *     is acceptable.  The J2000 method is best matched to the way
10987     *     the argument is handled internally and will deliver the
10988     *     optimum resolution.  The MJD method and the date &amp; time methods
10989     *     are both good compromises between resolution and convenience.
10990     *
10991     * <li> The matrix operates in the sense V(true) = rmatn * V(mean), where
10992     *     the p-vector V(true) is with respect to the true equatorial triad
10993     *     of date and the p-vector V(mean) is with respect to the mean
10994     *     equatorial triad of date.
10995     *</ol>
10996     *<p>Called:<ul>
10997     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
10998     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
10999     *     <li>{@link #jauNumat} form nutation matrix
11000     * </ul>
11001     *<p>Reference:
11002     *
11003     *     <p>Explanatory Supplement to the Astronomical Almanac,
11004     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11005     *     Section 3.222-3 (p114).
11006     *
11007     *@version 2008 May 12
11008     *
11009     *  @since Release 20101201
11010     *
11011     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11012     */
11013     public static double[][] jauNum06a(double date1, double date2)
11014     {
11015        double eps, rmatn[][];
11016 
11017 
11018     /* Mean obliquity. */
11019        eps = jauObl06(date1, date2);
11020 
11021     /* Nutation components. */
11022        NutationTerms nut = jauNut06a(date1, date2);
11023 
11024     /* Nutation matrix. */
11025        rmatn = jauNumat(eps, nut.dpsi, nut.deps);
11026 
11027        return rmatn;
11028 
11029         }
11030     
11031 
11032     /**
11033     *  Form the matrix of nutation.
11034     *
11035     *<p>This function is derived from the International Astronomical Union's
11036     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11037     *
11038     *<p>Status:  support function.
11039     *
11040     *<!-- Given: -->
11041     *     @param epsa         double          mean obliquity of date (Note 1)
11042     *     @param dpsi double          nutation (Note 2)
11043     *     @param deps double          nutation (Note 2) 
11044     *
11045     *<!-- Returned: -->
11046     *     @return rmatn        double[3][3]     <u>returned</u> nutation matrix (Note 3)
11047     *
11048     * <p>Notes:
11049     * <ol>
11050     *
11051     *
11052     * <li> The supplied mean obliquity epsa, must be consistent with the
11053     *     precession-nutation models from which dpsi and deps were obtained.
11054     *
11055     * <li> The caller is responsible for providing the nutation components;
11056     *     they are in longitude and obliquity, in radians and are with
11057     *     respect to the equinox and ecliptic of date.
11058     *
11059     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
11060     *     where the p-vector V(true) is with respect to the true
11061     *     equatorial triad of date and the p-vector V(mean) is with
11062     *     respect to the mean equatorial triad of date.
11063     *</ol>
11064     *<p>Called:<ul>
11065     *     <li>{@link #jauIr} initialize r-matrix to identity
11066     *     <li>{@link #jauRx} rotate around X-axis
11067     *     <li>{@link #jauRz} rotate around Z-axis
11068     * </ul>
11069     *<p>Reference:
11070     *
11071     *     <p>Explanatory Supplement to the Astronomical Almanac,
11072     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
11073     *     Section 3.222-3 (p114).
11074     *
11075     *@version 2008 May 11
11076     *
11077     *  @since Release 20101201
11078     *
11079     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11080     */
11081     public static double[][] jauNumat(double epsa, double dpsi, double deps)
11082     {
11083         double rmatn[][] = new double[3][3];
11084     /* Build the rotation matrix. */
11085        jauIr(rmatn);
11086        jauRx(epsa, rmatn);
11087        jauRz(-dpsi, rmatn);
11088        jauRx(-(epsa + deps), rmatn);
11089 
11090        return rmatn;
11091 
11092         }
11093     /**
11094      * Nutation Terms.
11095      *  .
11096      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
11097      * @version $Revision$ $date$
11098      */
11099     public static class NutationTerms {
11100         /**  nutation component in longitude  */
11101         public double dpsi;
11102         /**  nutation component in obliquity */
11103         public double deps;
11104         public NutationTerms(double dpsi, double deps) {
11105             this.dpsi = dpsi;
11106             this.deps = deps;
11107         }
11108     }
11109     /**
11110     *  Nutation, IAU 2000A model (MHB2000 luni-solar and planetary nutation
11111     *  with free core nutation omitted).
11112     *
11113     *<p>This function is derived from the International Astronomical Union's
11114     *  SOFA (Standards Of Fundamental Astronomy) software collection.
11115     *
11116     *<p>Status:  canonical model.
11117     *
11118     *<!-- Given: -->
11119     *     @param date1 double TT as a 2-part Julian Date (Note 1)
11120     *     @param date2 double TT as a 2-part Julian Date (Note 1)
11121     *
11122     *<!-- Returned: -->
11123     *     @return    <u>returned</u> nutation, luni-solar + planetary (Note 2)
11124     *
11125     * <p>Notes:
11126     * <ol>
11127     *
11128     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
11129     *     convenient way between the two arguments.  For example,
11130     *     JD(TT)=2450123.7 could be expressed in any of these ways,
11131     *     among others:
11132     *<pre>
11133     *            date1          date2
11134     *
11135     *         2450123.7           0.0       (JD method)
11136     *         2451545.0       -1421.3       (J2000 method)
11137     *         2400000.5       50123.2       (MJD method)
11138     *         2450123.5           0.2       (date &amp; time method)
11139     *</pre>
11140     *     The JD method is the most natural and convenient to use in
11141     *     cases where the loss of several decimal digits of resolution
11142     *     is acceptable.  The J2000 method is best matched to the way
11143     *     the argument is handled internally and will deliver the
11144     *     optimum resolution.  The MJD method and the date &amp; time methods
11145     *     are both good compromises between resolution and convenience.
11146     *
11147     * <li> The nutation components in longitude and obliquity are in radians
11148     *     and with respect to the equinox and ecliptic of date.  The
11149     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
11150     *     value of 84381.448 arcsec.
11151     *
11152     *     Both the luni-solar and planetary nutations are included.  The
11153     *     latter are due to direct planetary nutations and the
11154     *     perturbations of the lunar and terrestrial orbits.
11155     *
11156     * <li> The function computes the MHB2000 nutation series with the
11157     *     associated corrections for planetary nutations.  It is an
11158     *     implementation of the nutation part of the IAU 2000A precession-
11159     *     nutation model, formally adopted by the IAU General Assembly in
11160     *     2000, namely MHB2000 (Mathews et al. 2002), but with the free
11161     *     core nutation (FCN - see Note 4) omitted.
11162     *
11163     * <li> The full MHB2000 model also contains contributions to the
11164     *     nutations in longitude and obliquity due to the free-excitation
11165     *     of the free-core-nutation during the period 1979-2000.  These FCN
11166     *     terms, which are time-dependent and unpredictable, are NOT
11167     *     included in the present function and, if required, must be
11168     *     independently computed.  With the FCN corrections included, the
11169     *     present function delivers a pole which is at current epochs
11170     *     accurate to a few hundred microarcseconds.  The omission of FCN
11171     *     introduces further errors of about that size.
11172     *
11173     * <li> The present function provides classical nutation.  The MHB2000
11174     *     algorithm, from which it is adapted, deals also with (i) the
11175     *     offsets between the GCRS and mean poles and (ii) the adjustments
11176     *     in longitude and obliquity due to the changed precession rates.
11177     *     These additional functions, namely frame bias and precession
11178     *     adjustments, are supported by the JSOFA functions jauBi00  and
11179     *     jauPr00.
11180     *
11181     * <li> The MHB2000 algorithm also provides "total" nutations, comprising
11182     *     the arithmetic sum of the frame bias, precession adjustments,
11183     *     luni-solar nutation and planetary nutation.  These total
11184     *     nutations can be used in combination with an existing IAU 1976
11185     *     precession implementation, such as jauPmat76,  to deliver GCRS-
11186     *     to-true predictions of sub-mas accuracy at current dates.
11187     *     However, there are three shortcomings in the MHB2000 model that
11188     *     must be taken into account if more accurate or definitive results
11189     *     are required (see Wallace 2002):
11190     *
11191     *       (i) The MHB2000 total nutations are simply arithmetic sums,
11192     *           yet in reality the various components are successive Euler
11193     *           rotations.  This slight lack of rigor leads to cross terms
11194     *           that exceed 1 mas after a century.  The rigorous procedure
11195     *           is to form the GCRS-to-true rotation matrix by applying the
11196     *           bias, precession and nutation in that order.
11197     *
11198     *      (ii) Although the precession adjustments are stated to be with
11199     *           respect to Lieske et al. (1977), the MHB2000 model does
11200     *           not specify which set of Euler angles are to be used and
11201     *           how the adjustments are to be applied.  The most literal
11202     *           and straightforward procedure is to adopt the 4-rotation
11203     *           epsilon_0, psi_A, omega_A, xi_A option, and to add DPSIPR
11204     *           to psi_A and DEPSPR to both omega_A and eps_A.
11205     *
11206     *     (iii) The MHB2000 model predates the determination by Chapront
11207     *           et al. (2002) of a 14.6 mas displacement between the
11208     *           J2000.0 mean equinox and the origin of the ICRS frame.  It
11209     *           should, however, be noted that neglecting this displacement
11210     *           when calculating star coordinates does not lead to a
11211     *           14.6 mas change in right ascension, only a small second-
11212     *           order distortion in the pattern of the precession-nutation
11213     *           effect.
11214     *
11215     *     For these reasons, the JSOFA functions do not generate the "total
11216     *     nutations" directly, though they can of course easily be
11217     *     generated by calling jauBi00, jauPr00 and the present function
11218     *     and adding the results.
11219     *
11220     * <li> The MHB2000 model contains 41 instances where the same frequency
11221     *     appears multiple times, of which 38 are duplicates and three are
11222     *     triplicates.  To keep the present code close to the original MHB
11223     *     algorithm, this small inefficiency has not been corrected.
11224     *</ol>
11225     *<p>Called:<ul>
11226     *     <li>{@link #jauFal03} mean anomaly of the Moon
11227     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
11228     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
11229     *     <li>{@link #jauFame03} mean longitude of Mercury
11230     *     <li>{@link #jauFave03} mean longitude of Venus
11231     *     <li>{@link #jauFae03} mean longitude of Earth
11232     *     <li>{@link #jauFama03} mean longitude of Mars
11233     *     <li>{@link #jauFaju03} mean longitude of Jupiter
11234     *     <li>{@link #jauFasa03} mean longitude of Saturn
11235     *     <li>{@link #jauFaur03} mean longitude of Uranus
11236     *     <li>{@link #jauFapa03} general accumulated precession in longitude
11237     * </ul>
11238     *<p>References:
11239     *
11240     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
11241     *     Astron.Astrophys. 387, 700
11242     *
11243     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
11244     *     Astron.Astrophys. 58, 1-16
11245     *
11246     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
11247     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
11248     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
11249     *
11250     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
11251     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
11252     *
11253     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
11254     *     Astron.Astrophys.Supp.Ser. 135, 111
11255     *
11256     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
11257     *     Resolutions", in IERS Workshop 5.1 (2002)
11258     *
11259     *@version 2009 December 17
11260     *
11261     *  @since Release 20101201
11262     *
11263     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
11264     */
11265     public static NutationTerms jauNut00a(double date1, double date2 )
11266     {
11267        int i;
11268        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
11269               al, af, ad, aom, alme, alve, alea, alma,
11270               alju, alsa, alur, alne, apa, dpsils, depsls,
11271               dpsipl, depspl;
11272 
11273     /* Units of 0.1 microarcsecond to radians */
11274        final double U2R = DAS2R / 1e7;
11275 
11276     /* ------------------------- */
11277     /* Luni-Solar nutation model */
11278     /* ------------------------- */
11279 
11280     /* The units for the sine and cosine coefficients are */
11281     /* 0.1 microarcsecond and the same per Julian century */
11282 
11283        final class NutationModel {
11284           int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
11285           double sp,spt,cp;     /* longitude sin, t*sin, cos coefficients */
11286           double ce,cet,se;     /* obliquity cos, t*cos, sin coefficients */
11287           public NutationModel(int nl,int nlp,int nf,int nd, int nom,
11288           double sp,double spt,double cp,     
11289           double ce,double cet,double se ) {
11290            this.nl = nl;
11291            this.nlp = nlp;
11292            this.nf = nf;
11293            this.nd = nd;
11294            this.nom = nom;
11295            this.sp = sp;
11296            this.spt = spt;
11297            this.cp = cp;
11298            this.ce = ce;
11299            this.cet = cet;
11300            this.se = se;
11301         }
11302        }
11303        
11304        NutationModel xls[] = {
11305 
11306        /* 1- 10 */
11307           new NutationModel( 0, 0, 0, 0, 1,
11308              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
11309           new NutationModel( 0, 0, 2,-2, 2,
11310                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
11311           new NutationModel( 0, 0, 2, 0, 2,-2276413.0,-234.0,2796.0,978459.0,-485.0, 1374.0),
11312           new NutationModel( 0, 0, 0, 0, 2,2074554.0, 207.0, -698.0,-897492.0,470.0, -291.0),
11313           new NutationModel( 0, 1, 0, 0, 0,1475877.0,-3633.0,11817.0,73871.0,-184.0,-1924.0),
11314           new NutationModel( 0, 1, 2,-2, 2,-516821.0,1226.0, -524.0,224386.0,-677.0, -174.0),
11315           new NutationModel( 1, 0, 0, 0, 0, 711159.0,  73.0, -872.0,  -6750.0,  0.0,  358.0),
11316           new NutationModel( 0, 0, 2, 0, 1,-387298.0,-367.0,  380.0, 200728.0, 18.0,  318.0),
11317           new NutationModel( 1, 0, 2, 0, 2,-301461.0, -36.0,  816.0, 129025.0,-63.0,  367.0),
11318           new NutationModel( 0,-1, 2,-2, 2, 215829.0,-494.0,  111.0, -95929.0,299.0,  132.0),
11319 
11320        /* 11-20 */
11321           new NutationModel( 0, 0, 2,-2, 1, 128227.0, 137.0,  181.0, -68982.0, -9.0,   39.0),
11322           new NutationModel(-1, 0, 2, 0, 2, 123457.0,  11.0,   19.0, -53311.0, 32.0,   -4.0),
11323           new NutationModel(-1, 0, 0, 2, 0, 156994.0,  10.0, -168.0,  -1235.0,  0.0,   82.0),
11324           new NutationModel( 1, 0, 0, 0, 1,  63110.0,  63.0,   27.0, -33228.0,  0.0,   -9.0),
11325           new NutationModel(-1, 0, 0, 0, 1, -57976.0, -63.0, -189.0,  31429.0,  0.0,  -75.0),
11326           new NutationModel(-1, 0, 2, 2, 2, -59641.0, -11.0,  149.0,  25543.0,-11.0,   66.0),
11327           new NutationModel( 1, 0, 2, 0, 1, -51613.0, -42.0,  129.0,  26366.0,  0.0,   78.0),
11328           new NutationModel(-2, 0, 2, 0, 1,  45893.0,  50.0,   31.0, -24236.0,-10.0,   20.0),
11329           new NutationModel( 0, 0, 0, 2, 0,  63384.0,  11.0, -150.0,  -1220.0,  0.0,   29.0),
11330           new NutationModel( 0, 0, 2, 2, 2, -38571.0,  -1.0,  158.0,  16452.0,-11.0,   68.0),
11331 
11332        /* 21-30 */
11333           new NutationModel( 0,-2, 2,-2, 2,  32481.0,   0.0,    0.0, -13870.0,  0.0,    0.0),
11334           new NutationModel(-2, 0, 0, 2, 0, -47722.0,   0.0,  -18.0,    477.0,  0.0,  -25.0),
11335           new NutationModel( 2, 0, 2, 0, 2, -31046.0,  -1.0,  131.0,  13238.0,-11.0,   59.0),
11336           new NutationModel( 1, 0, 2,-2, 2,  28593.0,   0.0,   -1.0, -12338.0, 10.0,   -3.0),
11337           new NutationModel(-1, 0, 2, 0, 1,  20441.0,  21.0,   10.0, -10758.0,  0.0,   -3.0),
11338           new NutationModel( 2, 0, 0, 0, 0,  29243.0,   0.0,  -74.0,   -609.0,  0.0,   13.0),
11339           new NutationModel( 0, 0, 2, 0, 0,  25887.0,   0.0,  -66.0,   -550.0,  0.0,   11.0),
11340           new NutationModel( 0, 1, 0, 0, 1, -14053.0, -25.0,   79.0,   8551.0, -2.0,  -45.0),
11341           new NutationModel(-1, 0, 0, 2, 1,  15164.0,  10.0,   11.0,  -8001.0,  0.0,   -1.0),
11342           new NutationModel( 0, 2, 2,-2, 2, -15794.0,  72.0,  -16.0,   6850.0,-42.0,   -5.0),
11343 
11344        /* 31-40 */
11345           new NutationModel( 0, 0,-2, 2, 0,  21783.0,   0.0,   13.0,   -167.0,  0.0,   13.0),
11346           new NutationModel( 1, 0, 0,-2, 1, -12873.0, -10.0,  -37.0,   6953.0,  0.0,  -14.0),
11347           new NutationModel( 0,-1, 0, 0, 1, -12654.0,  11.0,   63.0,   6415.0,  0.0,   26.0),
11348           new NutationModel(-1, 0, 2, 2, 1, -10204.0,   0.0,   25.0,   5222.0,  0.0,   15.0),
11349           new NutationModel( 0, 2, 0, 0, 0,  16707.0, -85.0,  -10.0,    168.0, -1.0,   10.0),
11350           new NutationModel( 1, 0, 2, 2, 2,  -7691.0,   0.0,   44.0,   3268.0,  0.0,   19.0),
11351           new NutationModel(-2, 0, 2, 0, 0, -11024.0,   0.0,  -14.0,    104.0,  0.0,    2.0),
11352           new NutationModel( 0, 1, 2, 0, 2,   7566.0, -21.0,  -11.0,  -3250.0,  0.0,   -5.0),
11353           new NutationModel( 0, 0, 2, 2, 1,  -6637.0, -11.0,   25.0,   3353.0,  0.0,   14.0),
11354           new NutationModel( 0,-1, 2, 0, 2,  -7141.0,  21.0,    8.0,   3070.0,  0.0,    4.0),
11355 
11356        /* 41-50 */
11357           new NutationModel( 0, 0, 0, 2, 1,  -6302.0, -11.0,    2.0,   3272.0,  0.0,    4.0),
11358           new NutationModel( 1, 0, 2,-2, 1,   5800.0,  10.0,    2.0,  -3045.0,  0.0,   -1.0),
11359           new NutationModel( 2, 0, 2,-2, 2,   6443.0,   0.0,   -7.0,  -2768.0,  0.0,   -4.0),
11360           new NutationModel(-2, 0, 0, 2, 1,  -5774.0, -11.0,  -15.0,   3041.0,  0.0,   -5.0),
11361           new NutationModel( 2, 0, 2, 0, 1,  -5350.0,   0.0,   21.0,   2695.0,  0.0,   12.0),
11362           new NutationModel( 0,-1, 2,-2, 1,  -4752.0, -11.0,   -3.0,   2719.0,  0.0,   -3.0),
11363           new NutationModel( 0, 0, 0,-2, 1,  -4940.0, -11.0,  -21.0,   2720.0,  0.0,   -9.0),
11364           new NutationModel(-1,-1, 0, 2, 0,   7350.0,   0.0,   -8.0,    -51.0,  0.0,    4.0),
11365           new NutationModel( 2, 0, 0,-2, 1,   4065.0,   0.0,    6.0,  -2206.0,  0.0,    1.0),
11366           new NutationModel( 1, 0, 0, 2, 0,   6579.0,   0.0,  -24.0,   -199.0,  0.0,    2.0),
11367 
11368        /* 51-60 */
11369           new NutationModel( 0, 1, 2,-2, 1,   3579.0,   0.0,    5.0,  -1900.0,  0.0,    1.0),
11370           new NutationModel( 1,-1, 0, 0, 0,   4725.0,   0.0,   -6.0,    -41.0,  0.0,    3.0),
11371           new NutationModel(-2, 0, 2, 0, 2,  -3075.0,   0.0,   -2.0,   1313.0,  0.0,   -1.0),
11372           new NutationModel( 3, 0, 2, 0, 2,  -2904.0,   0.0,   15.0,   1233.0,  0.0,    7.0),
11373           new NutationModel( 0,-1, 0, 2, 0,   4348.0,   0.0,  -10.0,    -81.0,  0.0,    2.0),
11374           new NutationModel( 1,-1, 2, 0, 2,  -2878.0,   0.0,    8.0,   1232.0,  0.0,    4.0),
11375           new NutationModel( 0, 0, 0, 1, 0,  -4230.0,   0.0,    5.0,    -20.0,  0.0,   -2.0),
11376           new NutationModel(-1,-1, 2, 2, 2,  -2819.0,   0.0,    7.0,   1207.0,  0.0,    3.0),
11377           new NutationModel(-1, 0, 2, 0, 0,  -4056.0,   0.0,    5.0,     40.0,  0.0,   -2.0),
11378           new NutationModel( 0,-1, 2, 2, 2,  -2647.0,   0.0,   11.0,   1129.0,  0.0,    5.0),
11379 
11380        /* 61-70 */
11381           new NutationModel(-2, 0, 0, 0, 1,  -2294.0,   0.0,  -10.0,   1266.0,  0.0,   -4.0),
11382           new NutationModel( 1, 1, 2, 0, 2,   2481.0,   0.0,   -7.0,  -1062.0,  0.0,   -3.0),
11383           new NutationModel( 2, 0, 0, 0, 1,   2179.0,   0.0,   -2.0,  -1129.0,  0.0,   -2.0),
11384           new NutationModel(-1, 1, 0, 1, 0,   3276.0,   0.0,    1.0,     -9.0,  0.0,    0.0),
11385           new NutationModel( 1, 1, 0, 0, 0,  -3389.0,   0.0,    5.0,     35.0,  0.0,   -2.0),
11386           new NutationModel( 1, 0, 2, 0, 0,   3339.0,   0.0,  -13.0,   -107.0,  0.0,    1.0),
11387           new NutationModel(-1, 0, 2,-2, 1,  -1987.0,   0.0,   -6.0,   1073.0,  0.0,   -2.0),
11388           new NutationModel( 1, 0, 0, 0, 2,  -1981.0,   0.0,    0.0,    854.0,  0.0,    0.0),
11389           new NutationModel(-1, 0, 0, 1, 0,   4026.0,   0.0, -353.0,   -553.0,  0.0, -139.0),
11390           new NutationModel( 0, 0, 2, 1, 2,   1660.0,   0.0,   -5.0,   -710.0,  0.0,   -2.0),
11391 
11392        /* 71-80 */
11393           new NutationModel(-1, 0, 2, 4, 2,  -1521.0,   0.0,    9.0,    647.0,  0.0,    4.0),
11394           new NutationModel(-1, 1, 0, 1, 1,   1314.0,   0.0,    0.0,   -700.0,  0.0,    0.0),
11395           new NutationModel( 0,-2, 2,-2, 1,  -1283.0,   0.0,    0.0,    672.0,  0.0,    0.0),
11396           new NutationModel( 1, 0, 2, 2, 1,  -1331.0,   0.0,    8.0,    663.0,  0.0,    4.0),
11397           new NutationModel(-2, 0, 2, 2, 2,   1383.0,   0.0,   -2.0,   -594.0,  0.0,   -2.0),
11398           new NutationModel(-1, 0, 0, 0, 2,   1405.0,   0.0,    4.0,   -610.0,  0.0,    2.0),
11399           new NutationModel( 1, 1, 2,-2, 2,   1290.0,   0.0,    0.0,   -556.0,  0.0,    0.0),
11400           new NutationModel(-2, 0, 2, 4, 2,  -1214.0,   0.0,    5.0,    518.0,  0.0,    2.0),
11401           new NutationModel(-1, 0, 4, 0, 2,   1146.0,   0.0,   -3.0,   -490.0,  0.0,   -1.0),
11402           new NutationModel( 2, 0, 2,-2, 1,   1019.0,   0.0,   -1.0,   -527.0,  0.0,   -1.0),
11403 
11404        /* 81-90 */
11405           new NutationModel( 2, 0, 2, 2, 2,  -1100.0,   0.0,    9.0,    465.0,  0.0,    4.0),
11406           new NutationModel( 1, 0, 0, 2, 1,   -970.0,   0.0,    2.0,    496.0,  0.0,    1.0),
11407           new NutationModel( 3, 0, 0, 0, 0,   1575.0,   0.0,   -6.0,    -50.0,  0.0,    0.0),
11408           new NutationModel( 3, 0, 2,-2, 2,    934.0,   0.0,   -3.0,   -399.0,  0.0,   -1.0),
11409           new NutationModel( 0, 0, 4,-2, 2,    922.0,   0.0,   -1.0,   -395.0,  0.0,   -1.0),
11410           new NutationModel( 0, 1, 2, 0, 1,    815.0,   0.0,   -1.0,   -422.0,  0.0,   -1.0),
11411           new NutationModel( 0, 0,-2, 2, 1,    834.0,   0.0,    2.0,   -440.0,  0.0,    1.0),
11412           new NutationModel( 0, 0, 2,-2, 3,   1248.0,   0.0,    0.0,   -170.0,  0.0,    1.0),
11413           new NutationModel(-1, 0, 0, 4, 0,   1338.0,   0.0,   -5.0,    -39.0,  0.0,    0.0),
11414           new NutationModel( 2, 0,-2, 0, 1,    716.0,   0.0,   -2.0,   -389.0,  0.0,   -1.0),
11415 
11416        /* 91-100 */
11417           new NutationModel(-2, 0, 0, 4, 0,   1282.0,   0.0,   -3.0,    -23.0,  0.0,    1.0),
11418           new NutationModel(-1,-1, 0, 2, 1,    742.0,   0.0,    1.0,   -391.0,  0.0,    0.0),
11419           new NutationModel(-1, 0, 0, 1, 1,   1020.0,   0.0,  -25.0,   -495.0,  0.0,  -10.0),
11420           new NutationModel( 0, 1, 0, 0, 2,    715.0,   0.0,   -4.0,   -326.0,  0.0,    2.0),
11421           new NutationModel( 0, 0,-2, 0, 1,   -666.0,   0.0,   -3.0,    369.0,  0.0,   -1.0),
11422           new NutationModel( 0,-1, 2, 0, 1,   -667.0,   0.0,    1.0,    346.0,  0.0,    1.0),
11423           new NutationModel( 0, 0, 2,-1, 2,   -704.0,   0.0,    0.0,    304.0,  0.0,    0.0),
11424           new NutationModel( 0, 0, 2, 4, 2,   -694.0,   0.0,    5.0,    294.0,  0.0,    2.0),
11425           new NutationModel(-2,-1, 0, 2, 0,  -1014.0,   0.0,   -1.0,      4.0,  0.0,   -1.0),
11426           new NutationModel( 1, 1, 0,-2, 1,   -585.0,   0.0,   -2.0,    316.0,  0.0,   -1.0),
11427 
11428        /* 101-110 */
11429           new NutationModel(-1, 1, 0, 2, 0,   -949.0,   0.0,    1.0,      8.0,  0.0,   -1.0),
11430           new NutationModel(-1, 1, 0, 1, 2,   -595.0,   0.0,    0.0,    258.0,  0.0,    0.0),
11431           new NutationModel( 1,-1, 0, 0, 1,    528.0,   0.0,    0.0,   -279.0,  0.0,    0.0),
11432           new NutationModel( 1,-1, 2, 2, 2,   -590.0,   0.0,    4.0,    252.0,  0.0,    2.0),
11433           new NutationModel(-1, 1, 2, 2, 2,    570.0,   0.0,   -2.0,   -244.0,  0.0,   -1.0),
11434           new NutationModel( 3, 0, 2, 0, 1,   -502.0,   0.0,    3.0,    250.0,  0.0,    2.0),
11435           new NutationModel( 0, 1,-2, 2, 0,   -875.0,   0.0,    1.0,     29.0,  0.0,    0.0),
11436           new NutationModel(-1, 0, 0,-2, 1,   -492.0,   0.0,   -3.0,    275.0,  0.0,   -1.0),
11437           new NutationModel( 0, 1, 2, 2, 2,    535.0,   0.0,   -2.0,   -228.0,  0.0,   -1.0),
11438           new NutationModel(-1,-1, 2, 2, 1,   -467.0,   0.0,    1.0,    240.0,  0.0,    1.0),
11439 
11440        /* 111-120 */
11441           new NutationModel( 0,-1, 0, 0, 2,    591.0,   0.0,    0.0,   -253.0,  0.0,    0.0),
11442           new NutationModel( 1, 0, 2,-4, 1,   -453.0,   0.0,   -1.0,    244.0,  0.0,   -1.0),
11443           new NutationModel(-1, 0,-2, 2, 0,    766.0,   0.0,    1.0,      9.0,  0.0,    0.0),
11444           new NutationModel( 0,-1, 2, 2, 1,   -446.0,   0.0,    2.0,    225.0,  0.0,    1.0),
11445           new NutationModel( 2,-1, 2, 0, 2,   -488.0,   0.0,    2.0,    207.0,  0.0,    1.0),
11446           new NutationModel( 0, 0, 0, 2, 2,   -468.0,   0.0,    0.0,    201.0,  0.0,    0.0),
11447           new NutationModel( 1,-1, 2, 0, 1,   -421.0,   0.0,    1.0,    216.0,  0.0,    1.0),
11448           new NutationModel(-1, 1, 2, 0, 2,    463.0,   0.0,    0.0,   -200.0,  0.0,    0.0),
11449           new NutationModel( 0, 1, 0, 2, 0,   -673.0,   0.0,    2.0,     14.0,  0.0,    0.0),
11450           new NutationModel( 0,-1,-2, 2, 0,    658.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11451 
11452        /* 121-130 */
11453           new NutationModel( 0, 3, 2,-2, 2,   -438.0,   0.0,    0.0,    188.0,  0.0,    0.0),
11454           new NutationModel( 0, 0, 0, 1, 1,   -390.0,   0.0,    0.0,    205.0,  0.0,    0.0),
11455           new NutationModel(-1, 0, 2, 2, 0,    639.0, -11.0,   -2.0,    -19.0,  0.0,    0.0),
11456           new NutationModel( 2, 1, 2, 0, 2,    412.0,   0.0,   -2.0,   -176.0,  0.0,   -1.0),
11457           new NutationModel( 1, 1, 0, 0, 1,   -361.0,   0.0,    0.0,    189.0,  0.0,    0.0),
11458           new NutationModel( 1, 1, 2, 0, 1,    360.0,   0.0,   -1.0,   -185.0,  0.0,   -1.0),
11459           new NutationModel( 2, 0, 0, 2, 0,    588.0,   0.0,   -3.0,    -24.0,  0.0,    0.0),
11460           new NutationModel( 1, 0,-2, 2, 0,   -578.0,   0.0,    1.0,      5.0,  0.0,    0.0),
11461           new NutationModel(-1, 0, 0, 2, 2,   -396.0,   0.0,    0.0,    171.0,  0.0,    0.0),
11462           new NutationModel( 0, 1, 0, 1, 0,    565.0,   0.0,   -1.0,     -6.0,  0.0,    0.0),
11463 
11464        /* 131-140 */
11465           new NutationModel( 0, 1, 0,-2, 1,   -335.0,   0.0,   -1.0,    184.0,  0.0,   -1.0),
11466           new NutationModel(-1, 0, 2,-2, 2,    357.0,   0.0,    1.0,   -154.0,  0.0,    0.0),
11467           new NutationModel( 0, 0, 0,-1, 1,    321.0,   0.0,    1.0,   -174.0,  0.0,    0.0),
11468           new NutationModel(-1, 1, 0, 0, 1,   -301.0,   0.0,   -1.0,    162.0,  0.0,    0.0),
11469           new NutationModel( 1, 0, 2,-1, 2,   -334.0,   0.0,    0.0,    144.0,  0.0,    0.0),
11470           new NutationModel( 1,-1, 0, 2, 0,    493.0,   0.0,   -2.0,    -15.0,  0.0,    0.0),
11471           new NutationModel( 0, 0, 0, 4, 0,    494.0,   0.0,   -2.0,    -19.0,  0.0,    0.0),
11472           new NutationModel( 1, 0, 2, 1, 2,    337.0,   0.0,   -1.0,   -143.0,  0.0,   -1.0),
11473           new NutationModel( 0, 0, 2, 1, 1,    280.0,   0.0,   -1.0,   -144.0,  0.0,    0.0),
11474           new NutationModel( 1, 0, 0,-2, 2,    309.0,   0.0,    1.0,   -134.0,  0.0,    0.0),
11475 
11476        /* 141-150 */
11477           new NutationModel(-1, 0, 2, 4, 1,   -263.0,   0.0,    2.0,    131.0,  0.0,    1.0),
11478           new NutationModel( 1, 0,-2, 0, 1,    253.0,   0.0,    1.0,   -138.0,  0.0,    0.0),
11479           new NutationModel( 1, 1, 2,-2, 1,    245.0,   0.0,    0.0,   -128.0,  0.0,    0.0),
11480           new NutationModel( 0, 0, 2, 2, 0,    416.0,   0.0,   -2.0,    -17.0,  0.0,    0.0),
11481           new NutationModel(-1, 0, 2,-1, 1,   -229.0,   0.0,    0.0,    128.0,  0.0,    0.0),
11482           new NutationModel(-2, 0, 2, 2, 1,    231.0,   0.0,    0.0,   -120.0,  0.0,    0.0),
11483           new NutationModel( 4, 0, 2, 0, 2,   -259.0,   0.0,    2.0,    109.0,  0.0,    1.0),
11484           new NutationModel( 2,-1, 0, 0, 0,    375.0,   0.0,   -1.0,     -8.0,  0.0,    0.0),
11485           new NutationModel( 2, 1, 2,-2, 2,    252.0,   0.0,    0.0,   -108.0,  0.0,    0.0),
11486           new NutationModel( 0, 1, 2, 1, 2,   -245.0,   0.0,    1.0,    104.0,  0.0,    0.0),
11487 
11488        /* 151-160 */
11489           new NutationModel( 1, 0, 4,-2, 2,    243.0,   0.0,   -1.0,   -104.0,  0.0,    0.0),
11490           new NutationModel(-1,-1, 0, 0, 1,    208.0,   0.0,    1.0,   -112.0,  0.0,    0.0),
11491           new NutationModel( 0, 1, 0, 2, 1,    199.0,   0.0,    0.0,   -102.0,  0.0,    0.0),
11492           new NutationModel(-2, 0, 2, 4, 1,   -208.0,   0.0,    1.0,    105.0,  0.0,    0.0),
11493           new NutationModel( 2, 0, 2, 0, 0,    335.0,   0.0,   -2.0,    -14.0,  0.0,    0.0),
11494           new NutationModel( 1, 0, 0, 1, 0,   -325.0,   0.0,    1.0,      7.0,  0.0,    0.0),
11495           new NutationModel(-1, 0, 0, 4, 1,   -187.0,   0.0,    0.0,     96.0,  0.0,    0.0),
11496           new NutationModel(-1, 0, 4, 0, 1,    197.0,   0.0,   -1.0,   -100.0,  0.0,    0.0),
11497           new NutationModel( 2, 0, 2, 2, 1,   -192.0,   0.0,    2.0,     94.0,  0.0,    1.0),
11498           new NutationModel( 0, 0, 2,-3, 2,   -188.0,   0.0,    0.0,     83.0,  0.0,    0.0),
11499 
11500        /* 161-170 */
11501           new NutationModel(-1,-2, 0, 2, 0,    276.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11502           new NutationModel( 2, 1, 0, 0, 0,   -286.0,   0.0,    1.0,      6.0,  0.0,    0.0),
11503           new NutationModel( 0, 0, 4, 0, 2,    186.0,   0.0,   -1.0,    -79.0,  0.0,    0.0),
11504           new NutationModel( 0, 0, 0, 0, 3,   -219.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11505           new NutationModel( 0, 3, 0, 0, 0,    276.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11506           new NutationModel( 0, 0, 2,-4, 1,   -153.0,   0.0,   -1.0,     84.0,  0.0,    0.0),
11507           new NutationModel( 0,-1, 0, 2, 1,   -156.0,   0.0,    0.0,     81.0,  0.0,    0.0),
11508           new NutationModel( 0, 0, 0, 4, 1,   -154.0,   0.0,    1.0,     78.0,  0.0,    0.0),
11509           new NutationModel(-1,-1, 2, 4, 2,   -174.0,   0.0,    1.0,     75.0,  0.0,    0.0),
11510           new NutationModel( 1, 0, 2, 4, 2,   -163.0,   0.0,    2.0,     69.0,  0.0,    1.0),
11511 
11512        /* 171-180 */
11513           new NutationModel(-2, 2, 0, 2, 0,   -228.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11514           new NutationModel(-2,-1, 2, 0, 1,     91.0,   0.0,   -4.0,    -54.0,  0.0,   -2.0),
11515           new NutationModel(-2, 0, 0, 2, 2,    175.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11516           new NutationModel(-1,-1, 2, 0, 2,   -159.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11517           new NutationModel( 0, 0, 4,-2, 1,    141.0,   0.0,    0.0,    -72.0,  0.0,    0.0),
11518           new NutationModel( 3, 0, 2,-2, 1,    147.0,   0.0,    0.0,    -75.0,  0.0,    0.0),
11519           new NutationModel(-2,-1, 0, 2, 1,   -132.0,   0.0,    0.0,     69.0,  0.0,    0.0),
11520           new NutationModel( 1, 0, 0,-1, 1,    159.0,   0.0,  -28.0,    -54.0,  0.0,   11.0),
11521           new NutationModel( 0,-2, 0, 2, 0,    213.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11522           new NutationModel(-2, 0, 0, 4, 1,    123.0,   0.0,    0.0,    -64.0,  0.0,    0.0),
11523 
11524        /* 181-190 */
11525           new NutationModel(-3, 0, 0, 0, 1,   -118.0,   0.0,   -1.0,     66.0,  0.0,    0.0),
11526           new NutationModel( 1, 1, 2, 2, 2,    144.0,   0.0,   -1.0,    -61.0,  0.0,    0.0),
11527           new NutationModel( 0, 0, 2, 4, 1,   -121.0,   0.0,    1.0,     60.0,  0.0,    0.0),
11528           new NutationModel( 3, 0, 2, 2, 2,   -134.0,   0.0,    1.0,     56.0,  0.0,    1.0),
11529           new NutationModel(-1, 1, 2,-2, 1,   -105.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11530           new NutationModel( 2, 0, 0,-4, 1,   -102.0,   0.0,    0.0,     56.0,  0.0,    0.0),
11531           new NutationModel( 0, 0, 0,-2, 2,    120.0,   0.0,    0.0,    -52.0,  0.0,    0.0),
11532           new NutationModel( 2, 0, 2,-4, 1,    101.0,   0.0,    0.0,    -54.0,  0.0,    0.0),
11533           new NutationModel(-1, 1, 0, 2, 1,   -113.0,   0.0,    0.0,     59.0,  0.0,    0.0),
11534           new NutationModel( 0, 0, 2,-1, 1,   -106.0,   0.0,    0.0,     61.0,  0.0,    0.0),
11535 
11536        /* 191-200 */
11537           new NutationModel( 0,-2, 2, 2, 2,   -129.0,   0.0,    1.0,     55.0,  0.0,    0.0),
11538           new NutationModel( 2, 0, 0, 2, 1,   -114.0,   0.0,    0.0,     57.0,  0.0,    0.0),
11539           new NutationModel( 4, 0, 2,-2, 2,    113.0,   0.0,   -1.0,    -49.0,  0.0,    0.0),
11540           new NutationModel( 2, 0, 0,-2, 2,   -102.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11541           new NutationModel( 0, 2, 0, 0, 1,    -94.0,   0.0,    0.0,     51.0,  0.0,    0.0),
11542           new NutationModel( 1, 0, 0,-4, 1,   -100.0,   0.0,   -1.0,     56.0,  0.0,    0.0),
11543           new NutationModel( 0, 2, 2,-2, 1,     87.0,   0.0,    0.0,    -47.0,  0.0,    0.0),
11544           new NutationModel(-3, 0, 0, 4, 0,    161.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11545           new NutationModel(-1, 1, 2, 0, 1,     96.0,   0.0,    0.0,    -50.0,  0.0,    0.0),
11546           new NutationModel(-1,-1, 0, 4, 0,    151.0,   0.0,   -1.0,     -5.0,  0.0,    0.0),
11547 
11548        /* 201-210 */
11549           new NutationModel(-1,-2, 2, 2, 2,   -104.0,   0.0,    0.0,     44.0,  0.0,    0.0),
11550           new NutationModel(-2,-1, 2, 4, 2,   -110.0,   0.0,    0.0,     48.0,  0.0,    0.0),
11551           new NutationModel( 1,-1, 2, 2, 1,   -100.0,   0.0,    1.0,     50.0,  0.0,    0.0),
11552           new NutationModel(-2, 1, 0, 2, 0,     92.0,   0.0,   -5.0,     12.0,  0.0,   -2.0),
11553           new NutationModel(-2, 1, 2, 0, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11554           new NutationModel( 2, 1, 0,-2, 1,     82.0,   0.0,    0.0,    -45.0,  0.0,    0.0),
11555           new NutationModel(-3, 0, 2, 0, 1,    -78.0,   0.0,    0.0,     41.0,  0.0,    0.0),
11556           new NutationModel(-2, 0, 2,-2, 1,    -77.0,   0.0,    0.0,     43.0,  0.0,    0.0),
11557           new NutationModel(-1, 1, 0, 2, 2,      2.0,   0.0,    0.0,     54.0,  0.0,    0.0),
11558           new NutationModel( 0,-1, 2,-1, 2,     94.0,   0.0,    0.0,    -40.0,  0.0,    0.0),
11559 
11560        /* 211-220 */
11561           new NutationModel(-1, 0, 4,-2, 2,    -93.0,   0.0,    0.0,     40.0,  0.0,    0.0),
11562           new NutationModel( 0,-2, 2, 0, 2,    -83.0,   0.0,   10.0,     40.0,  0.0,   -2.0),
11563           new NutationModel(-1, 0, 2, 1, 2,     83.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11564           new NutationModel( 2, 0, 0, 0, 2,    -91.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11565           new NutationModel( 0, 0, 2, 0, 3,    128.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11566           new NutationModel(-2, 0, 4, 0, 2,    -79.0,   0.0,    0.0,     34.0,  0.0,    0.0),
11567           new NutationModel(-1, 0,-2, 0, 1,    -83.0,   0.0,    0.0,     47.0,  0.0,    0.0),
11568           new NutationModel(-1, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -44.0,  0.0,    0.0),
11569           new NutationModel( 3, 0, 0, 0, 1,     83.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11570           new NutationModel(-1, 0, 2, 3, 2,     91.0,   0.0,    0.0,    -39.0,  0.0,    0.0),
11571 
11572        /* 221-230 */
11573           new NutationModel( 2,-1, 2, 0, 1,    -77.0,   0.0,    0.0,     39.0,  0.0,    0.0),
11574           new NutationModel( 0, 1, 2, 2, 1,     84.0,   0.0,    0.0,    -43.0,  0.0,    0.0),
11575           new NutationModel( 0,-1, 2, 4, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11576           new NutationModel( 2,-1, 2, 2, 2,    -92.0,   0.0,    1.0,     39.0,  0.0,    0.0),
11577           new NutationModel( 0, 2,-2, 2, 0,    -94.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11578           new NutationModel(-1,-1, 2,-1, 1,     68.0,   0.0,    0.0,    -36.0,  0.0,    0.0),
11579           new NutationModel( 0,-2, 0, 0, 1,    -61.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11580           new NutationModel( 1, 0, 2,-4, 2,     71.0,   0.0,    0.0,    -31.0,  0.0,    0.0),
11581           new NutationModel( 1,-1, 0,-2, 1,     62.0,   0.0,    0.0,    -34.0,  0.0,    0.0),
11582           new NutationModel(-1,-1, 2, 0, 1,    -63.0,   0.0,    0.0,     33.0,  0.0,    0.0),
11583 
11584        /* 231-240 */
11585           new NutationModel( 1,-1, 2,-2, 2,    -73.0,   0.0,    0.0,     32.0,  0.0,    0.0),
11586           new NutationModel(-2,-1, 0, 4, 0,    115.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11587           new NutationModel(-1, 0, 0, 3, 0,   -103.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11588           new NutationModel(-2,-1, 2, 2, 2,     63.0,   0.0,    0.0,    -28.0,  0.0,    0.0),
11589           new NutationModel( 0, 2, 2, 0, 2,     74.0,   0.0,    0.0,    -32.0,  0.0,    0.0),
11590           new NutationModel( 1, 1, 0, 2, 0,   -103.0,   0.0,   -3.0,      3.0,  0.0,   -1.0),
11591           new NutationModel( 2, 0, 2,-1, 2,    -69.0,   0.0,    0.0,     30.0,  0.0,    0.0),
11592           new NutationModel( 1, 0, 2, 1, 1,     57.0,   0.0,    0.0,    -29.0,  0.0,    0.0),
11593           new NutationModel( 4, 0, 0, 0, 0,     94.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11594           new NutationModel( 2, 1, 2, 0, 1,     64.0,   0.0,    0.0,    -33.0,  0.0,    0.0),
11595 
11596        /* 241-250 */
11597           new NutationModel( 3,-1, 2, 0, 2,    -63.0,   0.0,    0.0,     26.0,  0.0,    0.0),
11598           new NutationModel(-2, 2, 0, 2, 1,    -38.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11599           new NutationModel( 1, 0, 2,-3, 1,    -43.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11600           new NutationModel( 1, 1, 2,-4, 1,    -45.0,   0.0,    0.0,     23.0,  0.0,    0.0),
11601           new NutationModel(-1,-1, 2,-2, 1,     47.0,   0.0,    0.0,    -24.0,  0.0,    0.0),
11602           new NutationModel( 0,-1, 0,-1, 1,    -48.0,   0.0,    0.0,     25.0,  0.0,    0.0),
11603           new NutationModel( 0,-1, 0,-2, 1,     45.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11604           new NutationModel(-2, 0, 0, 0, 2,     56.0,   0.0,    0.0,    -25.0,  0.0,    0.0),
11605           new NutationModel(-2, 0,-2, 2, 0,     88.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11606           new NutationModel(-1, 0,-2, 4, 0,    -75.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11607 
11608        /* 251-260 */
11609           new NutationModel( 1,-2, 0, 0, 0,     85.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11610           new NutationModel( 0, 1, 0, 1, 1,     49.0,   0.0,    0.0,    -26.0,  0.0,    0.0),
11611           new NutationModel(-1, 2, 0, 2, 0,    -74.0,   0.0,   -3.0,     -1.0,  0.0,   -1.0),
11612           new NutationModel( 1,-1, 2,-2, 1,    -39.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11613           new NutationModel( 1, 2, 2,-2, 2,     45.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11614           new NutationModel( 2,-1, 2,-2, 2,     51.0,   0.0,    0.0,    -22.0,  0.0,    0.0),
11615           new NutationModel( 1, 0, 2,-1, 1,    -40.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11616           new NutationModel( 2, 1, 2,-2, 1,     41.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11617           new NutationModel(-2, 0, 0,-2, 1,    -42.0,   0.0,    0.0,     24.0,  0.0,    0.0),
11618           new NutationModel( 1,-2, 2, 0, 2,    -51.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11619 
11620        /* 261-270 */
11621           new NutationModel( 0, 1, 2, 1, 1,    -42.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11622           new NutationModel( 1, 0, 4,-2, 1,     39.0,   0.0,    0.0,    -21.0,  0.0,    0.0),
11623           new NutationModel(-2, 0, 4, 2, 2,     46.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11624           new NutationModel( 1, 1, 2, 1, 2,    -53.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11625           new NutationModel( 1, 0, 0, 4, 0,     82.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11626           new NutationModel( 1, 0, 2, 2, 0,     81.0,   0.0,   -1.0,     -4.0,  0.0,    0.0),
11627           new NutationModel( 2, 0, 2, 1, 2,     47.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11628           new NutationModel( 3, 1, 2, 0, 2,     53.0,   0.0,    0.0,    -23.0,  0.0,    0.0),
11629           new NutationModel( 4, 0, 2, 0, 1,    -45.0,   0.0,    0.0,     22.0,  0.0,    0.0),
11630           new NutationModel(-2,-1, 2, 0, 0,    -44.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11631 
11632        /* 271-280 */
11633           new NutationModel( 0, 1,-2, 2, 1,    -33.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11634           new NutationModel( 1, 0,-2, 1, 0,    -61.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11635           new NutationModel( 0,-1,-2, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11636           new NutationModel( 2,-1, 0,-2, 1,    -38.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11637           new NutationModel(-1, 0, 2,-1, 2,    -33.0,   0.0,    0.0,     21.0,  0.0,    0.0),
11638           new NutationModel( 1, 0, 2,-3, 2,    -60.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11639           new NutationModel( 0, 1, 2,-2, 3,     48.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11640           new NutationModel( 0, 0, 2,-3, 1,     27.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11641           new NutationModel(-1, 0,-2, 2, 1,     38.0,   0.0,    0.0,    -20.0,  0.0,    0.0),
11642           new NutationModel( 0, 0, 2,-4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11643 
11644        /* 281-290 */
11645           new NutationModel(-2, 1, 0, 0, 1,    -29.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11646           new NutationModel(-1, 0, 0,-1, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11647           new NutationModel( 2, 0, 2,-4, 2,    -32.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11648           new NutationModel( 0, 0, 4,-4, 4,     45.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11649           new NutationModel( 0, 0, 4,-4, 2,    -44.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11650           new NutationModel(-1,-2, 0, 2, 1,     28.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11651           new NutationModel(-2, 0, 0, 3, 0,    -51.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11652           new NutationModel( 1, 0,-2, 2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11653           new NutationModel(-3, 0, 2, 2, 2,     44.0,   0.0,    0.0,    -19.0,  0.0,    0.0),
11654           new NutationModel(-3, 0, 2, 2, 1,     26.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11655 
11656        /* 291-300 */
11657           new NutationModel(-2, 0, 2, 2, 0,    -60.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11658           new NutationModel( 2,-1, 0, 0, 1,     35.0,   0.0,    0.0,    -18.0,  0.0,    0.0),
11659           new NutationModel(-2, 1, 2, 2, 2,    -27.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11660           new NutationModel( 1, 1, 0, 1, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11661           new NutationModel( 0, 1, 4,-2, 2,     36.0,   0.0,    0.0,    -15.0,  0.0,    0.0),
11662           new NutationModel(-1, 1, 0,-2, 1,    -36.0,   0.0,    0.0,     20.0,  0.0,    0.0),
11663           new NutationModel( 0, 0, 0,-4, 1,    -35.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11664           new NutationModel( 1,-1, 0, 2, 1,    -37.0,   0.0,    0.0,     19.0,  0.0,    0.0),
11665           new NutationModel( 1, 1, 0, 2, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11666           new NutationModel(-1, 2, 2, 2, 2,     35.0,   0.0,    0.0,    -14.0,  0.0,    0.0),
11667 
11668        /* 301-310 */
11669           new NutationModel( 3, 1, 2,-2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11670           new NutationModel( 0,-1, 0, 4, 0,     65.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11671           new NutationModel( 2,-1, 0, 2, 0,     47.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11672           new NutationModel( 0, 0, 4, 0, 1,     32.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11673           new NutationModel( 2, 0, 4,-2, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11674           new NutationModel(-1,-1, 2, 4, 1,    -30.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11675           new NutationModel( 1, 0, 0, 4, 1,    -32.0,   0.0,    0.0,     16.0,  0.0,    0.0),
11676           new NutationModel( 1,-2, 2, 2, 2,    -31.0,   0.0,    0.0,     13.0,  0.0,    0.0),
11677           new NutationModel( 0, 0, 2, 3, 2,     37.0,   0.0,    0.0,    -16.0,  0.0,    0.0),
11678           new NutationModel(-1, 1, 2, 4, 2,     31.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11679 
11680        /* 311-320 */
11681           new NutationModel( 3, 0, 0, 2, 0,     49.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11682           new NutationModel(-1, 0, 4, 2, 2,     32.0,   0.0,    0.0,    -13.0,  0.0,    0.0),
11683           new NutationModel( 1, 1, 2, 2, 1,     23.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11684           new NutationModel(-2, 0, 2, 6, 2,    -43.0,   0.0,    0.0,     18.0,  0.0,    0.0),
11685           new NutationModel( 2, 1, 2, 2, 2,     26.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11686           new NutationModel(-1, 0, 2, 6, 2,    -32.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11687           new NutationModel( 1, 0, 2, 4, 1,    -29.0,   0.0,    0.0,     14.0,  0.0,    0.0),
11688           new NutationModel( 2, 0, 2, 4, 2,    -27.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11689           new NutationModel( 1, 1,-2, 1, 0,     30.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11690           new NutationModel(-3, 1, 2, 1, 2,    -11.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11691 
11692        /* 321-330 */
11693           new NutationModel( 2, 0,-2, 0, 2,    -21.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11694           new NutationModel(-1, 0, 0, 1, 2,    -34.0,   0.0,    0.0,     15.0,  0.0,    0.0),
11695           new NutationModel(-4, 0, 2, 2, 1,    -10.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11696           new NutationModel(-1,-1, 0, 1, 0,    -36.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11697           new NutationModel( 0, 0,-2, 2, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11698           new NutationModel( 1, 0, 0,-1, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11699           new NutationModel( 0,-1, 2,-2, 3,    -21.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11700           new NutationModel(-2, 1, 2, 0, 0,    -29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11701           new NutationModel( 0, 0, 2,-2, 4,    -15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11702           new NutationModel(-2,-2, 0, 2, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11703 
11704        /* 331-340 */
11705           new NutationModel(-2, 0,-2, 4, 0,     28.0,   0.0,    0.0,      0.0,  0.0,   -2.0),
11706           new NutationModel( 0,-2,-2, 2, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11707           new NutationModel( 1, 2, 0,-2, 1,    -22.0,   0.0,    0.0,     12.0,  0.0,    0.0),
11708           new NutationModel( 3, 0, 0,-4, 1,    -14.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11709           new NutationModel(-1, 1, 2,-2, 2,     24.0,   0.0,    0.0,    -11.0,  0.0,    0.0),
11710           new NutationModel( 1,-1, 2,-4, 1,     11.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11711           new NutationModel( 1, 1, 0,-2, 2,     14.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11712           new NutationModel(-3, 0, 2, 0, 0,     24.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11713           new NutationModel(-3, 0, 2, 0, 2,     18.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11714           new NutationModel(-2, 0, 0, 1, 0,    -38.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11715 
11716        /* 341-350 */
11717           new NutationModel( 0, 0,-2, 1, 0,    -31.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11718           new NutationModel(-3, 0, 0, 2, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11719           new NutationModel(-1,-1,-2, 2, 0,     29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11720           new NutationModel( 0, 1, 2,-4, 1,    -18.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11721           new NutationModel( 2, 1, 0,-4, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11722           new NutationModel( 0, 2, 0,-2, 1,    -17.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11723           new NutationModel( 1, 0, 0,-3, 1,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11724           new NutationModel(-2, 0, 2,-2, 2,     16.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11725           new NutationModel(-2,-1, 0, 0, 1,     22.0,   0.0,    0.0,    -12.0,  0.0,    0.0),
11726           new NutationModel(-4, 0, 0, 2, 0,     20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11727 
11728        /* 351-360 */
11729           new NutationModel( 1, 1, 0,-4, 1,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11730           new NutationModel(-1, 0, 2,-4, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11731           new NutationModel( 0, 0, 4,-4, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11732           new NutationModel( 0, 3, 2,-2, 2,      0.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11733           new NutationModel(-3,-1, 0, 4, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11734           new NutationModel(-3, 0, 0, 4, 1,     19.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11735           new NutationModel( 1,-1,-2, 2, 0,    -34.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11736           new NutationModel(-1,-1, 0, 2, 2,    -20.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11737           new NutationModel( 1,-2, 0, 0, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11738           new NutationModel( 1,-1, 0, 0, 2,    -18.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11739 
11740        /* 361-370 */
11741           new NutationModel( 0, 0, 0, 1, 2,     13.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11742           new NutationModel(-1,-1, 2, 0, 0,     17.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11743           new NutationModel( 1,-2, 2,-2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11744           new NutationModel( 0,-1, 2,-1, 1,     15.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11745           new NutationModel(-1, 0, 2, 0, 3,    -11.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11746           new NutationModel( 1, 1, 0, 0, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11747           new NutationModel(-1, 1, 2, 0, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11748           new NutationModel( 1, 2, 0, 0, 0,    -35.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11749           new NutationModel(-1, 2, 2, 0, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11750           new NutationModel(-1, 0, 4,-2, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11751 
11752        /* 371-380 */
11753           new NutationModel( 3, 0, 2,-4, 2,    -26.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11754           new NutationModel( 1, 2, 2,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11755           new NutationModel( 1, 0, 4,-4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11756           new NutationModel(-2,-1, 0, 4, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11757           new NutationModel( 0,-1, 0, 2, 2,    -21.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11758           new NutationModel(-2, 1, 0, 4, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11759           new NutationModel(-2,-1, 2, 2, 1,      9.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11760           new NutationModel( 2, 0,-2, 2, 0,    -29.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11761           new NutationModel( 1, 0, 0, 1, 1,    -19.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11762           new NutationModel( 0, 1, 0, 2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11763 
11764        /* 381-390 */
11765           new NutationModel( 1,-1, 2,-1, 2,     22.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11766           new NutationModel(-2, 0, 4, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11767           new NutationModel( 2, 1, 0, 0, 1,    -20.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11768           new NutationModel( 0, 1, 2, 0, 0,    -20.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11769           new NutationModel( 0,-1, 4,-2, 2,    -17.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11770           new NutationModel( 0, 0, 4,-2, 4,     15.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11771           new NutationModel( 0, 2, 2, 0, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11772           new NutationModel(-3, 0, 0, 6, 0,     14.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11773           new NutationModel(-1,-1, 0, 4, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11774           new NutationModel( 1,-2, 0, 2, 0,     25.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11775 
11776        /* 391-400 */
11777           new NutationModel(-1, 0, 0, 4, 2,    -13.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11778           new NutationModel(-1,-2, 2, 2, 1,    -14.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11779           new NutationModel(-1, 0, 0,-2, 2,     13.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11780           new NutationModel( 1, 0,-2,-2, 1,    -17.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11781           new NutationModel( 0, 0,-2,-2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11782           new NutationModel(-2, 0,-2, 0, 1,    -10.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11783           new NutationModel( 0, 0, 0, 3, 1,     10.0,   0.0,    0.0,     -6.0,  0.0,    0.0),
11784           new NutationModel( 0, 0, 0, 3, 0,    -15.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11785           new NutationModel(-1, 1, 0, 4, 0,    -22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11786           new NutationModel(-1,-1, 2, 2, 0,     28.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11787 
11788        /* 401-410 */
11789           new NutationModel(-2, 0, 2, 3, 2,     15.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11790           new NutationModel( 1, 0, 0, 2, 2,     23.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11791           new NutationModel( 0,-1, 2, 1, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11792           new NutationModel( 3,-1, 0, 0, 0,     29.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11793           new NutationModel( 2, 0, 0, 1, 0,    -25.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11794           new NutationModel( 1,-1, 2, 0, 0,     22.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11795           new NutationModel( 0, 0, 2, 1, 0,    -18.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11796           new NutationModel( 1, 0, 2, 0, 3,     15.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11797           new NutationModel( 3, 1, 0, 0, 0,    -23.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11798           new NutationModel( 3,-1, 2,-2, 2,     12.0,   0.0,    0.0,     -5.0,  0.0,    0.0),
11799 
11800        /* 411-420 */
11801           new NutationModel( 2, 0, 2,-1, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11802           new NutationModel( 1, 1, 2, 0, 0,    -19.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11803           new NutationModel( 0, 0, 4,-1, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11804           new NutationModel( 1, 2, 2, 0, 2,     21.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11805           new NutationModel(-2, 0, 0, 6, 0,     23.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11806           new NutationModel( 0,-1, 0, 4, 1,    -16.0,   0.0,    0.0,      8.0,  0.0,    0.0),
11807           new NutationModel(-2,-1, 2, 4, 1,    -19.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11808           new NutationModel( 0,-2, 2, 2, 1,    -22.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11809           new NutationModel( 0,-1, 2, 2, 0,     27.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11810           new NutationModel(-1, 0, 2, 3, 1,     16.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11811 
11812        /* 421-430 */
11813           new NutationModel(-2, 1, 2, 4, 2,     19.0,   0.0,    0.0,     -8.0,  0.0,    0.0),
11814           new NutationModel( 2, 0, 0, 2, 2,      9.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11815           new NutationModel( 2,-2, 2, 0, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11816           new NutationModel(-1, 1, 2, 3, 2,     -9.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11817           new NutationModel( 3, 0, 2,-1, 2,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11818           new NutationModel( 4, 0, 2,-2, 1,     18.0,   0.0,    0.0,     -9.0,  0.0,    0.0),
11819           new NutationModel(-1, 0, 0, 6, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11820           new NutationModel(-1,-2, 2, 4, 2,    -10.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11821           new NutationModel(-3, 0, 2, 6, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11822           new NutationModel(-1, 0, 2, 4, 0,     16.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11823 
11824        /* 431-440 */
11825           new NutationModel( 3, 0, 0, 2, 1,    -12.0,   0.0,    0.0,      6.0,  0.0,    0.0),
11826           new NutationModel( 3,-1, 2, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11827           new NutationModel( 3, 0, 2, 0, 0,     30.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11828           new NutationModel( 1, 0, 4, 0, 2,     24.0,   0.0,    0.0,    -10.0,  0.0,    0.0),
11829           new NutationModel( 5, 0, 2,-2, 2,     10.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11830           new NutationModel( 0,-1, 2, 4, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11831           new NutationModel( 2,-1, 2, 2, 1,    -16.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11832           new NutationModel( 0, 1, 2, 4, 2,     17.0,   0.0,    0.0,     -7.0,  0.0,    0.0),
11833           new NutationModel( 1,-1, 2, 4, 2,    -24.0,   0.0,    0.0,     10.0,  0.0,    0.0),
11834           new NutationModel( 3,-1, 2, 2, 2,    -12.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11835 
11836        /* 441-450 */
11837           new NutationModel( 3, 0, 2, 2, 1,    -24.0,   0.0,    0.0,     11.0,  0.0,    0.0),
11838           new NutationModel( 5, 0, 2, 0, 2,    -23.0,   0.0,    0.0,      9.0,  0.0,    0.0),
11839           new NutationModel( 0, 0, 2, 6, 2,    -13.0,   0.0,    0.0,      5.0,  0.0,    0.0),
11840           new NutationModel( 4, 0, 2, 2, 2,    -15.0,   0.0,    0.0,      7.0,  0.0,    0.0),
11841           new NutationModel( 0,-1, 1,-1, 1,      0.0,   0.0,-1988.0,      0.0,  0.0,-1679.0),
11842           new NutationModel(-1, 0, 1, 0, 3,      0.0,   0.0,  -63.0,      0.0,  0.0,  -27.0),
11843           new NutationModel( 0,-2, 2,-2, 3,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11844           new NutationModel( 1, 0,-1, 0, 1,      0.0,   0.0,    5.0,      0.0,  0.0,    4.0),
11845           new NutationModel( 2,-2, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11846           new NutationModel(-1, 0, 1, 0, 2,      0.0,   0.0,  364.0,      0.0,  0.0,  176.0),
11847 
11848        /* 451-460 */
11849           new NutationModel(-1, 0, 1, 0, 1,      0.0,   0.0,-1044.0,      0.0,  0.0, -891.0),
11850           new NutationModel(-1,-1, 2,-1, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11851           new NutationModel(-2, 2, 0, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11852           new NutationModel(-1, 0, 1, 0, 0,      0.0,   0.0,  330.0,      0.0,  0.0,    0.0),
11853           new NutationModel(-4, 1, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11854           new NutationModel(-3, 0, 2, 1, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11855           new NutationModel(-2,-1, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11856           new NutationModel( 1, 0,-2, 1, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11857           new NutationModel( 2,-1,-2, 0, 1,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11858           new NutationModel(-4, 0, 2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11859 
11860        /* 461-470 */
11861           new NutationModel(-3, 1, 0, 3, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11862           new NutationModel(-1, 0,-1, 2, 0,      0.0,   0.0,    5.0,      0.0,  0.0,    0.0),
11863           new NutationModel( 0,-2, 0, 0, 2,      0.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11864           new NutationModel( 0,-2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11865           new NutationModel(-3, 0, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11866           new NutationModel(-2,-1, 0, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11867           new NutationModel(-1, 0,-2, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11868           new NutationModel(-4, 0, 0, 4, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11869           new NutationModel( 2, 1,-2, 0, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11870           new NutationModel( 2,-1, 0,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11871 
11872        /* 471-480 */
11873           new NutationModel( 0, 0, 1,-1, 0,     -5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11874           new NutationModel(-1, 2, 0, 1, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11875           new NutationModel(-2, 1, 2, 0, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11876           new NutationModel( 1, 1, 0,-1, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
11877           new NutationModel( 1, 0, 1,-2, 1,      0.0,   0.0,  -12.0,      0.0,  0.0,  -10.0),
11878           new NutationModel( 0, 2, 0, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11879           new NutationModel( 1,-1, 2,-3, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11880           new NutationModel(-1, 1, 2,-1, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11881           new NutationModel(-2, 0, 4,-2, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11882           new NutationModel(-2, 0, 4,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11883 
11884        /* 481-490 */
11885           new NutationModel(-2,-2, 0, 2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11886           new NutationModel(-2, 0,-2, 4, 0,      0.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11887           new NutationModel( 1, 2, 2,-4, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11888           new NutationModel( 1, 1, 2,-4, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11889           new NutationModel(-1, 2, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11890           new NutationModel( 2, 0, 0,-3, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11891           new NutationModel(-1, 2, 0, 0, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11892           new NutationModel( 0, 0, 0,-2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11893           new NutationModel(-1,-1, 2,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11894           new NutationModel(-1, 1, 0, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11895 
11896        /* 491-500 */
11897           new NutationModel( 0, 0, 0,-1, 2,     -8.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11898           new NutationModel(-2, 1, 0, 1, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11899           new NutationModel( 1,-2, 0,-2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11900           new NutationModel( 1, 0,-2, 0, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11901           new NutationModel(-3, 1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11902           new NutationModel(-1, 1,-2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11903           new NutationModel(-1,-1, 0, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11904           new NutationModel(-3, 0, 0, 2, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11905           new NutationModel(-3,-1, 0, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11906           new NutationModel( 2, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11907 
11908        /* 501-510 */
11909           new NutationModel( 0, 1, 2,-4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11910           new NutationModel( 2, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11911           new NutationModel(-2, 1, 2,-2, 1,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11912           new NutationModel( 0,-1, 2,-4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11913           new NutationModel( 0, 1, 0,-2, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11914           new NutationModel(-1, 0, 0,-2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11915           new NutationModel( 2, 0,-2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11916           new NutationModel(-4, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11917           new NutationModel(-1,-1, 0,-1, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11918           new NutationModel( 0, 0,-2, 0, 2,      9.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11919 
11920        /* 511-520 */
11921           new NutationModel(-3, 0, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11922           new NutationModel(-1, 0,-2, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11923           new NutationModel(-2, 0,-2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11924           new NutationModel( 0, 0,-4, 2, 0,      8.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11925           new NutationModel(-2,-1,-2, 2, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11926           new NutationModel( 1, 0, 2,-6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11927           new NutationModel(-1, 0, 2,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11928           new NutationModel( 1, 0, 0,-4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11929           new NutationModel( 2, 1, 2,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11930           new NutationModel( 2, 1, 2,-4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11931 
11932        /* 521-530 */
11933           new NutationModel( 0, 1, 4,-4, 4,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11934           new NutationModel( 0, 1, 4,-4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11935           new NutationModel(-1,-1,-2, 4, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11936           new NutationModel(-1,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11937           new NutationModel(-1, 0,-2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11938           new NutationModel(-2,-1, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11939           new NutationModel( 0, 0,-2, 3, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11940           new NutationModel(-2, 0, 0, 3, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11941           new NutationModel( 0,-1, 0, 1, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11942           new NutationModel(-3, 0, 2, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11943 
11944        /* 531-540 */
11945           new NutationModel( 1, 1,-2, 2, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11946           new NutationModel(-1, 1, 0, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11947           new NutationModel( 1,-2, 2,-2, 1,     10.0,   0.0,   13.0,      6.0,  0.0,   -5.0),
11948           new NutationModel( 0, 0, 1, 0, 2,      0.0,   0.0,   30.0,      0.0,  0.0,   14.0),
11949           new NutationModel( 0, 0, 1, 0, 1,      0.0,   0.0, -162.0,      0.0,  0.0, -138.0),
11950           new NutationModel( 0, 0, 1, 0, 0,      0.0,   0.0,   75.0,      0.0,  0.0,    0.0),
11951           new NutationModel(-1, 2, 0, 2, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
11952           new NutationModel( 0, 0, 2, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11953           new NutationModel(-2, 0, 2, 0, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11954           new NutationModel( 2, 0, 0,-1, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11955 
11956        /* 541-550 */
11957           new NutationModel( 3, 0, 0,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11958           new NutationModel( 1, 0, 2,-2, 3,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11959           new NutationModel( 1, 2, 0, 0, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11960           new NutationModel( 2, 0, 2,-3, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11961           new NutationModel(-1, 1, 4,-2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11962           new NutationModel(-2,-2, 0, 4, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11963           new NutationModel( 0,-3, 0, 2, 0,      9.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11964           new NutationModel( 0, 0,-2, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11965           new NutationModel(-1,-1, 0, 3, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11966           new NutationModel(-2, 0, 0, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11967 
11968        /* 551-560 */
11969           new NutationModel(-1, 0, 0, 3, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11970           new NutationModel( 2,-2, 0, 0, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11971           new NutationModel( 1,-1, 0, 1, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11972           new NutationModel(-1, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11973           new NutationModel( 0,-2, 2, 0, 1,     -6.0,   0.0,   -3.0,      3.0,  0.0,    1.0),
11974           new NutationModel(-1, 0, 1, 2, 1,      0.0,   0.0,   -3.0,      0.0,  0.0,   -2.0),
11975           new NutationModel(-1, 1, 0, 3, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11976           new NutationModel(-1,-1, 2, 1, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11977           new NutationModel( 0,-1, 2, 0, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11978           new NutationModel(-2, 1, 2, 2, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11979 
11980        /* 561-570 */
11981           new NutationModel( 2,-2, 2,-2, 2,     -1.0,   0.0,    3.0,      3.0,  0.0,   -1.0),
11982           new NutationModel( 1, 1, 0, 1, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
11983           new NutationModel( 1, 0, 1, 0, 1,      0.0,   0.0,  -13.0,      0.0,  0.0,  -11.0),
11984           new NutationModel( 1, 0, 1, 0, 0,      3.0,   0.0,    6.0,      0.0,  0.0,    0.0),
11985           new NutationModel( 0, 2, 0, 2, 0,     -7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11986           new NutationModel( 2,-1, 2,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11987           new NutationModel( 0,-1, 4,-2, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11988           new NutationModel( 0, 0, 4,-2, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11989           new NutationModel( 0, 1, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11990           new NutationModel( 4, 0, 2,-4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
11991 
11992        /* 571-580 */
11993           new NutationModel( 2, 2, 2,-2, 2,      8.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
11994           new NutationModel( 2, 0, 4,-4, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11995           new NutationModel(-1,-2, 0, 4, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
11996           new NutationModel(-1,-3, 2, 2, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
11997           new NutationModel(-3, 0, 2, 4, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
11998           new NutationModel(-3, 0, 2,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
11999           new NutationModel(-1,-1, 0,-2, 1,      8.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12000           new NutationModel(-3, 0, 0, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12001           new NutationModel(-3, 0,-2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12002           new NutationModel( 0, 1, 0,-4, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12003 
12004        /* 581-590 */
12005           new NutationModel(-2, 1, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12006           new NutationModel(-4, 0, 0, 0, 1,     -8.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12007           new NutationModel(-1, 0, 0,-4, 1,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12008           new NutationModel(-3, 0, 0,-2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12009           new NutationModel( 0, 0, 0, 3, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12010           new NutationModel(-1, 1, 0, 4, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12011           new NutationModel( 1,-2, 2, 0, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12012           new NutationModel( 0, 1, 0, 3, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12013           new NutationModel(-1, 0, 2, 2, 3,      6.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12014           new NutationModel( 0, 0, 2, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12015 
12016        /* 591-600 */
12017           new NutationModel(-2, 0, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12018           new NutationModel(-1, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12019           new NutationModel( 3, 0, 0, 0, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12020           new NutationModel( 2, 1, 0, 1, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12021           new NutationModel( 2,-1, 2,-1, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12022           new NutationModel( 0, 0, 2, 0, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12023           new NutationModel( 0, 0, 3, 0, 3,      0.0,   0.0,  -26.0,      0.0,  0.0,  -11.0),
12024           new NutationModel( 0, 0, 3, 0, 2,      0.0,   0.0,  -10.0,      0.0,  0.0,   -5.0),
12025           new NutationModel(-1, 2, 2, 2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12026           new NutationModel(-1, 0, 4, 0, 0,    -13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12027 
12028        /* 601-610 */
12029           new NutationModel( 1, 2, 2, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12030           new NutationModel( 3, 1, 2,-2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12031           new NutationModel( 1, 1, 4,-2, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12032           new NutationModel(-2,-1, 0, 6, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12033           new NutationModel( 0,-2, 0, 4, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12034           new NutationModel(-2, 0, 0, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12035           new NutationModel(-2,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12036           new NutationModel( 0,-3, 2, 2, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12037           new NutationModel( 0, 0, 0, 4, 2,     -7.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12038           new NutationModel(-1,-1, 2, 3, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12039 
12040        /* 611-620 */
12041           new NutationModel(-2, 0, 2, 4, 0,     13.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12042           new NutationModel( 2,-1, 0, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12043           new NutationModel( 1, 0, 0, 3, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12044           new NutationModel( 0, 1, 0, 4, 1,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12045           new NutationModel( 0, 1, 0, 4, 0,    -11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12046           new NutationModel( 1,-1, 2, 1, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12047           new NutationModel( 0, 0, 2, 2, 3,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12048           new NutationModel( 1, 0, 2, 2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12049           new NutationModel(-1, 0, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12050           new NutationModel(-2, 0, 4, 2, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12051 
12052        /* 621-630 */
12053           new NutationModel( 2, 1, 0, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12054           new NutationModel( 2, 1, 0, 2, 0,    -12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12055           new NutationModel( 2,-1, 2, 0, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12056           new NutationModel( 1, 0, 2, 1, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12057           new NutationModel( 0, 1, 2, 2, 0,     -4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12058           new NutationModel( 2, 0, 2, 0, 3,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12059           new NutationModel( 3, 0, 2, 0, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12060           new NutationModel( 1, 0, 2, 0, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12061           new NutationModel( 1, 0, 3, 0, 3,      0.0,   0.0,   -5.0,      0.0,  0.0,   -2.0),
12062           new NutationModel( 1, 1, 2, 1, 1,     -7.0,   0.0,    0.0,      4.0,  0.0,    0.0),
12063 
12064        /* 631-640 */
12065           new NutationModel( 0, 2, 2, 2, 2,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12066           new NutationModel( 2, 1, 2, 0, 0,     -3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12067           new NutationModel( 2, 0, 4,-2, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12068           new NutationModel( 4, 1, 2,-2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12069           new NutationModel(-1,-1, 0, 6, 0,      3.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12070           new NutationModel(-3,-1, 2, 6, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12071           new NutationModel(-1, 0, 0, 6, 1,     -5.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12072           new NutationModel(-3, 0, 2, 6, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12073           new NutationModel( 1,-1, 0, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12074           new NutationModel( 1,-1, 0, 4, 0,     12.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12075 
12076        /* 641-650 */
12077           new NutationModel(-2, 0, 2, 5, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12078           new NutationModel( 1,-2, 2, 2, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12079           new NutationModel( 3,-1, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12080           new NutationModel( 1,-1, 2, 2, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12081           new NutationModel( 0, 0, 2, 3, 1,      5.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12082           new NutationModel(-1, 1, 2, 4, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12083           new NutationModel( 0, 1, 2, 3, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12084           new NutationModel(-1, 0, 4, 2, 1,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12085           new NutationModel( 2, 0, 2, 1, 1,      6.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12086           new NutationModel( 5, 0, 0, 0, 0,      6.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12087 
12088        /* 651-660 */
12089           new NutationModel( 2, 1, 2, 1, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12090           new NutationModel( 1, 0, 4, 0, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12091           new NutationModel( 3, 1, 2, 0, 1,      7.0,   0.0,    0.0,     -4.0,  0.0,    0.0),
12092           new NutationModel( 3, 0, 4,-2, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12093           new NutationModel(-2,-1, 2, 6, 2,     -5.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12094           new NutationModel( 0, 0, 0, 6, 0,      5.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12095           new NutationModel( 0,-2, 2, 4, 2,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12096           new NutationModel(-2, 0, 2, 6, 1,     -6.0,   0.0,    0.0,      3.0,  0.0,    0.0),
12097           new NutationModel( 2, 0, 0, 4, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12098           new NutationModel( 2, 0, 0, 4, 0,     10.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12099 
12100        /* 661-670 */
12101           new NutationModel( 2,-2, 2, 2, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12102           new NutationModel( 0, 0, 2, 4, 0,      7.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12103           new NutationModel( 1, 0, 2, 3, 2,      7.0,   0.0,    0.0,     -3.0,  0.0,    0.0),
12104           new NutationModel( 4, 0, 0, 2, 0,      4.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12105           new NutationModel( 2, 0, 2, 2, 0,     11.0,   0.0,    0.0,      0.0,  0.0,    0.0),
12106           new NutationModel( 0, 0, 4, 2, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12107           new NutationModel( 4,-1, 2, 0, 2,     -6.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12108           new NutationModel( 3, 0, 2, 1, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12109           new NutationModel( 2, 1, 2, 2, 1,      3.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12110           new NutationModel( 4, 1, 2, 0, 2,      5.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12111 
12112        /* 671-678 */
12113           new NutationModel(-1,-1, 2, 6, 2,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12114           new NutationModel(-1, 0, 2, 6, 1,     -4.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12115           new NutationModel( 1,-1, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0),
12116           new NutationModel( 1, 1, 2, 4, 2,      4.0,   0.0,    0.0,     -2.0,  0.0,    0.0),
12117           new NutationModel( 3, 1, 2, 2, 2,      3.0,   0.0,    0.0,     -1.0,  0.0,    0.0),
12118           new NutationModel( 5, 0, 2, 0, 1,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12119           new NutationModel( 2,-1, 2, 4, 2,     -3.0,   0.0,    0.0,      1.0,  0.0,    0.0),
12120           new NutationModel( 2, 0, 2, 4, 1,     -3.0,   0.0,    0.0,      2.0,  0.0,    0.0)
12121        };
12122 
12123     /* Number of terms in the luni-solar nutation model */
12124        final int NLS = xls.length;
12125 
12126     /* ------------------------ */
12127     /* Planetary nutation model */
12128     /* ------------------------ */
12129 
12130     /* The units for the sine and cosine coefficients are */
12131     /* 0.1 microarcsecond                                 */
12132 
12133         final class PlanetaryNutModel {
12134          final int nl,               /* coefficients of l, F, D and Omega */
12135               nf,
12136               nd,
12137               nom,
12138               nme,              /* coefficients of planetary longitudes */
12139               nve,
12140               nea,
12141               nma,
12142               nju,
12143               nsa,
12144               nur,
12145               nne,
12146               npa;              /* coefficient of general precession */
12147           final int sp,cp;            /* longitude sin, cos coefficients */
12148           final int se,ce;            /* obliquity sin, cos coefficients */
12149           public PlanetaryNutModel(          int nl,               
12150                   int nf,
12151                   int nd,
12152                   int nom,
12153                   int nme,     
12154                   int nve,
12155                   int nea,
12156                   int nma,
12157                   int nju,
12158                   int nsa,
12159                   int nur,
12160                   int nne,
12161                   int npa,              
12162               int sp,int cp,           
12163               int se,int ce           
12164 ) {
12165               this.nl = nl;               /* coefficients of l, F, D and Omega */
12166               this.nf = nf;
12167               this.nd = nd;
12168               this.nom = nom;
12169               this.nme = nme;              /* coefficients of planetary longitudes */
12170               this.nve = nve;
12171               this.nea = nea;
12172               this.nma = nma;
12173               this.nju = nju;
12174               this.nsa = nsa;
12175               this.nur = nur;
12176               this.nne = nne;
12177               this.npa = npa;              /* coefficient of general precession */
12178            this.sp = sp; this.cp = cp;            /* longitude sin, cos coefficients */
12179            this.se = se; this.ce = ce;            /* obliquity sin, cos coefficients */
12180       
12181         }
12182        }
12183        
12184        PlanetaryNutModel xpl[] = {
12185 
12186        /* 1-10 */
12187           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 0, 1440,   0,    0,   0),
12188           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 16,-4,-5, 0, 0, 2,   56,-117,  -42, -40),
12189           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-16, 4, 5, 0, 0, 2,  125, -43,    0, -54),
12190           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0,-1, 2, 2,    0,   5,    0,   0),
12191           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-1,-5, 0, 0, 2,    3,  -7,   -3,   0),
12192           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 1,    3,   0,    0,  -2),
12193           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  3, -8, 3, 0, 0, 0, 0, -114,   0,    0,  61),
12194           new PlanetaryNutModel(-1, 0, 0, 0, 0, 10, -3,  0, 0, 0, 0, 0, 0, -219,  89,    0,   0),
12195           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 6,-3, 0, 2,   -3,   0,    0,   0),
12196           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0, -462,1604,    0,   0),
12197 
12198        /* 11-20 */
12199           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -5,  8,-3, 0, 0, 0, 0,   99,   0,    0, -53),
12200           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8,-3, 0, 0, 0, 1,   -3,   0,    0,   2),
12201           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 1, 5, 0, 0, 2,    0,   6,    2,   0),
12202           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  4, 0, 0, 0, 0, 2,    3,   0,    0,   0),
12203           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 2,  -12,   0,    0,   0),
12204           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 1,   14,-218,  117,   8),
12205           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2,-5, 0, 0, 0,   31,-481, -257, -17),
12206           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-5, 0, 0, 0, -491, 128,    0,   0),
12207           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 5, 0, 0, 0,-3084,5123, 2735,1647),
12208           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 1,-1444,2409,-1286,-771),
12209 
12210        /* 21-30 */
12211           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-2, 5, 0, 0, 2,   11, -24,  -11,  -9),
12212           new PlanetaryNutModel( 2,-1,-1, 0, 0,  0,  3, -7, 0, 0, 0, 0, 0,   26,  -9,    0,   0),
12213           new PlanetaryNutModel( 1, 0,-2, 0, 0, 19,-21,  3, 0, 0, 0, 0, 0,  103, -60,    0,   0),
12214           new PlanetaryNutModel( 0, 1,-1, 1, 0,  2, -4,  0,-3, 0, 0, 0, 0,    0, -13,   -7,   0),
12215           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -26, -29,  -16,  14),
12216           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-4,10, 0, 0, 0,    9, -27,  -14,  -5),
12217           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0, 0,-5, 0, 0, 0,   12,   0,    0,  -6),
12218           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -7,  4, 0, 0, 0, 0, 0,   -7,   0,    0,   0),
12219           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1,-1, 0, 0, 0,    0,  24,    0,   0),
12220           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,  284,   0,    0,-151),
12221 
12222        /* 31-40 */
12223           new PlanetaryNutModel(-1, 0, 0, 0, 0, 18,-16,  0, 0, 0, 0, 0, 0,  226, 101,    0,   0),
12224           new PlanetaryNutModel(-2, 1, 1, 2, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -8,   -2,   0),
12225           new PlanetaryNutModel(-1, 1,-1, 1, 0, 18,-17,  0, 0, 0, 0, 0, 0,    0,  -6,   -3,   0),
12226           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12227           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 2,  -41, 175,   76,  17),
12228           new PlanetaryNutModel( 0, 2,-2, 2, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,  15,    6,   0),
12229           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 13,  0, 0, 0, 0, 0, 1,  425, 212, -133, 269),
12230           new PlanetaryNutModel( 0, 1,-1, 1, 0, -8, 12,  0, 0, 0, 0, 0, 0, 1200, 598,  319,-641),
12231           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 0,  235, 334,    0,   0),
12232           new PlanetaryNutModel( 0, 1,-1, 1, 0,  8,-14,  0, 0, 0, 0, 0, 0,   11, -12,   -7,  -6),
12233 
12234        /* 41-50 */
12235           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8,-13,  0, 0, 0, 0, 0, 1,    5,  -6,    3,   3),
12236           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-4, 5, 0, 0, 0,   -5,   0,    0,   3),
12237           new PlanetaryNutModel(-2, 0, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12238           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 1, 0, 0, 0,   15,   0,    0,   0),
12239           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 2, 0, 0, 0, 0,   13,   0,    0,  -7),
12240           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-4, 3, 0, 0, 0,   -6,  -9,    0,   0),
12241           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,  266, -78,    0,   0),
12242           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  2, 0, 0, 0, 0, 0, -460,-435, -232, 246),
12243           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -2,  2, 0, 0, 0, 0, 0,    0,  15,    7,   0),
12244           new PlanetaryNutModel(-1, 1, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12245 
12246        /* 51-60 */
12247           new PlanetaryNutModel(-1, 0, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0, 131,    0,   0),
12248           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2,-2, 0, 0, 0,    4,   0,    0,   0),
12249           new PlanetaryNutModel(-2, 2, 0, 2, 0,  0, -5,  9, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12250           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0,-1, 0, 0,    0,   4,    2,   0),
12251           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 1, 0, 0,    0,   3,    0,   0),
12252           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 2, 0,  -17, -19,  -10,   9),
12253           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 1,   -9, -11,    6,  -5),
12254           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 2, 2,   -6,   0,    0,   3),
12255           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -16,   8,    0,   0),
12256           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 2, 0, 0, 0,    0,   3,    0,   0),
12257 
12258        /* 61-70 */
12259           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 2, 0, 0, 0,   11,  24,   11,  -5),
12260           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -9, 17, 0, 0, 0, 0, 0,   -3,  -4,   -2,   1),
12261           new PlanetaryNutModel( 0, 0, 0, 2, 0, -3,  5,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12262           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 2, 0, 0, 0,    0,  -8,   -4,   0),
12263           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1,-2, 0, 0, 0,    0,   3,    0,   0),
12264           new PlanetaryNutModel( 1, 0,-2, 0, 0, 17,-16,  0,-2, 0, 0, 0, 0,    0,   5,    0,   0),
12265           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1,-3, 0, 0, 0,    0,   3,    2,   0),
12266           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  5, -6, 0, 0, 0, 0, 0,   -6,   4,    2,   3),
12267           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  9,-13, 0, 0, 0, 0, 0,   -3,  -5,    0,   0),
12268           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0, 1, 0, 0, 0,   -5,   0,    0,   2),
12269 
12270        /* 71-80 */
12271           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0, 1, 0, 0, 0,    4,  24,   13,  -2),
12272           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0, 1, 0, 0, 0,  -42,  20,    0,   0),
12273           new PlanetaryNutModel( 0,-2, 2, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,  -10, 233,    0,   0),
12274           new PlanetaryNutModel( 0,-1, 1, 1, 0,  5, -7,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12275           new PlanetaryNutModel(-2, 0, 2, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   78, -18,    0,   0),
12276           new PlanetaryNutModel( 2, 1,-3, 1, 0, -6,  7,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12277           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  0,  0, 1, 0, 0, 0, 0,    0,  -3,   -1,   0),
12278           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  1,  0, 1, 0, 0, 0, 0,    0,  -4,   -2,   1),
12279           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 0, 2, 0, 0,    0,  -8,   -4,  -1),
12280           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 1,    0,  -5,    3,   0),
12281 
12282        /* 81-90 */
12283           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 2, 0, 2,   -7,   0,    0,   3),
12284           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 2,  -14,   8,    3,   6),
12285           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -8, 15, 0, 0, 0, 0, 1,    0,   8,   -4,   0),
12286           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -9, 15, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12287           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   45, -22,    0,   0),
12288           new PlanetaryNutModel( 1,-1,-1, 0, 0,  0,  8,-15, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12289           new PlanetaryNutModel( 2, 0,-2, 0, 0,  2, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12290           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-5, 5, 0, 0, 0,    0,   3,    0,   0),
12291           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -6,  8, 0, 0, 0, 0, 0,    3,   5,    3,  -2),
12292           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   89, -16,   -9, -48),
12293 
12294        /* 91-100 */
12295           new PlanetaryNutModel(-2, 1, 1, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,    0,   3,    0,   0),
12296           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-3, 0, 0, 0, 0,   -3,   7,    4,   2),
12297           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0, -349, -62,    0,   0),
12298           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  6, -8, 0, 0, 0, 0, 0,  -15,  22,    0,   0),
12299           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-1,-5, 0, 0, 0,   -3,   0,    0,   0),
12300           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,  -53,   0,    0,   0),
12301           new PlanetaryNutModel(-1, 1, 1, 1, 0,-20, 20,  0, 0, 0, 0, 0, 0,    5,   0,    0,  -3),
12302           new PlanetaryNutModel( 1, 0,-2, 0, 0, 20,-21,  0, 0, 0, 0, 0, 0,    0,  -8,    0,   0),
12303           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  8,-15, 0, 0, 0, 0, 0,   15,  -7,   -4,  -8),
12304           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,-10, 15, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12305 
12306        /* 101-110 */
12307           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,  -21, -78,    0,   0),
12308           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 1, 0, 0, 0, 0,   20, -70,  -37, -11),
12309           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,   6,    3,   0),
12310           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-2, 4, 0, 0, 0,    5,   3,    2,  -2),
12311           new PlanetaryNutModel( 2, 0,-2, 1, 0, -6,  8,  0, 0, 0, 0, 0, 0,  -17,  -4,   -2,   9),
12312           new PlanetaryNutModel( 0,-2, 2, 1, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   6,    3,   0),
12313           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0,-1, 0, 0, 1,   32,  15,   -8,  17),
12314           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-1, 0, 0, 0,  174,  84,   45, -93),
12315           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 0,   11,  56,    0,   0),
12316           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 1, 0, 0, 0,  -66, -12,   -6,  35),
12317 
12318        /* 111-120 */
12319           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 1,   47,   8,    4, -25),
12320           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 1, 0, 0, 2,    0,   8,    4,   0),
12321           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -9, 13, 0, 0, 0, 0, 0,   10, -22,  -12,  -5),
12322           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  7,-13, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12323           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,  -24,  12,    0,   0),
12324           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  9,-17, 0, 0, 0, 0, 0,    5,  -6,    0,   0),
12325           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -9, 17, 0, 0, 0, 0, 2,    3,   0,    0,  -2),
12326           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    4,   3,    1,  -2),
12327           new PlanetaryNutModel( 1, 0,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  29,   15,   0),
12328           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -1,  2, 0, 0, 0, 0, 0,   -5,  -4,   -2,   2),
12329 
12330        /* 121-130 */
12331           new PlanetaryNutModel( 0,-1, 1, 1, 0,  0,  0,  2, 0, 0, 0, 0, 0,    8,  -3,   -1,  -5),
12332           new PlanetaryNutModel( 0,-2, 2, 0, 1,  0, -2,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12333           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 2, 0, 0, 0, 0,   10,   0,    0,   0),
12334           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 1, 0, 0, 0,    3,   0,    0,  -2),
12335           new PlanetaryNutModel(-2, 0, 2, 1, 0,  3, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   3),
12336           new PlanetaryNutModel( 0, 0, 0, 1, 0,  8,-13,  0, 0, 0, 0, 0, 0,   46,  66,   35, -25),
12337           new PlanetaryNutModel( 0,-1, 1, 0, 0,  8,-12,  0, 0, 0, 0, 0, 0,  -14,   7,    0,   0),
12338           new PlanetaryNutModel( 0, 2,-2, 1, 0, -8, 11,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12339           new PlanetaryNutModel(-1, 0, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12340           new PlanetaryNutModel(-1, 0, 0, 1, 0, 18,-16,  0, 0, 0, 0, 0, 0,  -68, -34,  -18,  36),
12341 
12342        /* 131-140 */
12343           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 1, 0, 0, 0,    0,  14,    7,   0),
12344           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -7,  4, 0, 0, 0, 0, 0,   10,  -6,   -3,  -5),
12345           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0, -3,  7, 0, 0, 0, 0, 0,   -5,  -4,   -2,   3),
12346           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-2, 5, 0, 0, 0,   -3,   5,    2,   1),
12347           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-2, 5, 0, 0, 0,   76,  17,    9, -41),
12348           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,   84, 298,  159, -45),
12349           new PlanetaryNutModel( 1, 0, 0, 1, 0,-10,  3,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12350           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12351           new PlanetaryNutModel(-1, 0, 0, 1, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12352           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,  -82, 292,  156,  44),
12353 
12354        /* 141-150 */
12355           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 2,-5, 0, 0, 0,  -73,  17,    9,  39),
12356           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,   -9, -16,    0,   0),
12357           new PlanetaryNutModel( 2,-1,-1, 1, 0,  0,  3, -7, 0, 0, 0, 0, 0,    3,   0,   -1,  -2),
12358           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-5, 0, 0, 0,   -3,   0,    0,   0),
12359           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  7, -4, 0, 0, 0, 0, 0,   -9,  -5,   -3,   5),
12360           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0, -439,   0,    0,   0),
12361           new PlanetaryNutModel( 1, 0, 0, 1, 0,-18, 16,  0, 0, 0, 0, 0, 0,   57, -28,  -15, -30),
12362           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -6,   -3,   0),
12363           new PlanetaryNutModel( 0, 1,-1, 2, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12364           new PlanetaryNutModel( 0, 0, 0, 1, 0, -8, 13,  0, 0, 0, 0, 0, 0,  -40,  57,   30,  21),
12365 
12366        /* 151-160 */
12367           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 1,   23,   7,    3, -13),
12368           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  0, -2, 0, 0, 0, 0, 0,  273,  80,   43,-146),
12369           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -2, 0, 0, 0, 0, 0, -449, 430,    0,   0),
12370           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,   -8, -47,  -25,   4),
12371           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  2, 0, 0, 0, 0, 1,    6,  47,   25,  -3),
12372           new PlanetaryNutModel(-1, 0, 1, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  23,   13,   0),
12373           new PlanetaryNutModel(-1, 0, 1, 1, 0,  0,  3, -4, 0, 0, 0, 0, 0,   -3,   0,    0,   2),
12374           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0,-2, 0, 0, 0,    3,  -4,   -2,  -2),
12375           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 2, 0, 0, 0,  -48,-110,  -59,  26),
12376           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 1,   51, 114,   61, -27),
12377 
12378        /* 161-170 */
12379           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 2, 0, 0, 2, -133,   0,    0,  57),
12380           new PlanetaryNutModel( 0, 1,-1, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12381           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  5,  0, 0, 0, 0, 0, 0,  -21,  -6,   -3,  11),
12382           new PlanetaryNutModel( 0, 1,-1, 2, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,  -3,   -1,   0),
12383           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  4, 0, 0, 0, 0, 0,  -11, -21,  -11,   6),
12384           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,  -18,-436, -233,   9),
12385           new PlanetaryNutModel( 0,-1, 1, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   35,  -7,    0,   0),
12386           new PlanetaryNutModel( 0, 0, 0, 1, 0,  5, -8,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12387           new PlanetaryNutModel(-2, 0, 2, 1, 0,  6, -8,  0, 0, 0, 0, 0, 0,   11,  -3,   -1,  -6),
12388           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -8, 15, 0, 0, 0, 0, 0,   -5,  -3,   -1,   3),
12389 
12390        /* 171-180 */
12391           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  2,  0,-3, 0, 0, 0, 0,  -53,  -9,   -5,  28),
12392           new PlanetaryNutModel(-2, 0, 2, 1, 0,  0,  6, -8, 0, 0, 0, 0, 0,    0,   3,    2,   1),
12393           new PlanetaryNutModel( 1, 0,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    4,   0,    0,  -2),
12394           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3,-5, 0, 0, 0,    0,  -4,    0,   0),
12395           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0,-1, 0, 0, 0, 0,  -50, 194,  103,  27),
12396           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0,-1, 0, 0, 0, 1,  -13,  52,   28,   7),
12397           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 0,  -91, 248,    0,   0),
12398           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    6,  49,   26,  -3),
12399           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   -6, -47,  -25,   3),
12400           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 1,    0,   5,    3,   0),
12401 
12402        /* 181-190 */
12403           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 1, 0, 0, 0, 2,   52,  23,   10, -23),
12404           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 0,-1, 0, 0, 0,   -3,   0,    0,   1),
12405           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0, 0,-1, 0, 0, 0,    0,   5,    3,   0),
12406           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,   -4,   0,    0,   0),
12407           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 13, 0, 0, 0, 0, 2,   -4,   8,    3,   2),
12408           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7,-13, 0, 0, 0, 0, 0,   10,   0,    0,   0),
12409           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -5,  6, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12410           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -8, 11, 0, 0, 0, 0, 0,    0,   8,    4,   0),
12411           new PlanetaryNutModel( 0, 2,-2, 1,-1,  0,  2,  0, 0, 0, 0, 0, 0,    0,   8,    4,   1),
12412           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12413 
12414        /* 191-200 */
12415           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2,-2, 0, 0, 0,   -4,   0,    0,   0),
12416           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 0, 3, 0, 0, 0,   -8,   4,    2,   4),
12417           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 1,    8,  -4,   -2,  -4),
12418           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 3, 0, 0, 2,    0,  15,    7,   0),
12419           new PlanetaryNutModel(-2, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0, -138,   0,    0,   0),
12420           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12421           new PlanetaryNutModel( 0, 0, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -7,   -3,   0),
12422           new PlanetaryNutModel( 2, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   54,   0,    0, -29),
12423           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,  10,    4,   0),
12424           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0,  0, -2, 0, 0, 0, 0, 0,   -7,   0,    0,   3),
12425 
12426        /* 201-210 */
12427           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1, -2, 0, 0, 0, 0, 0,  -37,  35,   19,  20),
12428           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12429           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -4,   9,    0,   0),
12430           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 0, 2, 0, 0, 0,    8,   0,    0,  -4),
12431           new PlanetaryNutModel( 0, 1,-1, 1, 0,  3, -6,  0, 0, 0, 0, 0, 0,   -9, -14,   -8,   5),
12432           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 1,   -3,  -9,   -5,   3),
12433           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  0, 0, 0, 0, 0, 0, -145,  47,    0,   0),
12434           new PlanetaryNutModel( 0, 1,-1, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,  -10,  40,   21,   5),
12435           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 1,   11, -49,  -26,  -7),
12436           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,-2150,   0,    0, 932),
12437 
12438        /* 211-220 */
12439           new PlanetaryNutModel( 0, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,  -12,   0,    0,   5),
12440           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  5,  0, 0, 0, 0, 0, 2,   85,   0,    0, -37),
12441           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12442           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1, -4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12443           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -4, 0, 0, 0, 0, 0,  -86, 153,    0,   0),
12444           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -6,   9,    5,   3),
12445           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -3,  4, 0, 0, 0, 0, 0,    9, -13,   -7,  -5),
12446           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 1,   -8,  12,    6,   4),
12447           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  4, 0, 0, 0, 0, 2,  -51,   0,    0,  22),
12448           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,  -11,-268, -116,   5),
12449 
12450        /* 221-230 */
12451           new PlanetaryNutModel( 0, 2,-2, 2, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,  12,    5,   0),
12452           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 2,    0,   7,    3,   0),
12453           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   31,   6,    3, -17),
12454           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  7,  0, 0, 0, 0, 0, 0,  140,  27,   14, -75),
12455           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  8,  0, 0, 0, 0, 0, 1,   57,  11,    6, -30),
12456           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -8,  0, 0, 0, 0, 0, 0,  -14, -39,    0,   0),
12457           new PlanetaryNutModel( 0, 1,-1, 2, 0,  0, -1,  0,-1, 0, 0, 0, 0,    0,  -6,   -2,   0),
12458           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  0,  0,-1, 0, 0, 0, 0,    4,  15,    8,  -2),
12459           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    0,   4,    0,   0),
12460           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 1, 0, 0, 0, 0,   -3,   0,    0,   1),
12461 
12462        /* 231-240 */
12463           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 11, 0, 0, 0, 0, 2,    0,  11,    5,   0),
12464           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,-11, 0, 0, 0, 0, 0,    9,   6,    0,   0),
12465           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  4,  0, 0, 0, 0, 0, 2,   -4,  10,    4,   2),
12466           new PlanetaryNutModel( 0, 0, 0, 0, 1,  0, -4,  0, 0, 0, 0, 0, 0,    5,   3,    0,   0),
12467           new PlanetaryNutModel( 2, 0,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,   16,   0,    0,  -9),
12468           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   -3,   0,    0,   0),
12469           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -7,  9, 0, 0, 0, 0, 0,    0,   3,    2,  -1),
12470           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4,-5, 0, 0, 2,    7,   0,    0,  -3),
12471           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 0,  -25,  22,    0,   0),
12472           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,   42, 223,  119, -22),
12473 
12474        /* 241-250 */
12475           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,  -27,-143,  -77,  14),
12476           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 1,    9,  49,   26,  -5),
12477           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 2, 0, 0, 0, 2,-1166,   0,    0, 505),
12478           new PlanetaryNutModel( 0, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -5,   0,    0,   2),
12479           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 5, 0, 0, 2,   -6,   0,    0,   3),
12480           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -5,  0, 0, 0, 0, 0, 0,   -8,   0,    1,   4),
12481           new PlanetaryNutModel( 0,-1, 1, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12482           new PlanetaryNutModel( 0, 2,-2, 1, 0, -3,  3,  0, 0, 0, 0, 0, 0,  117,   0,    0, -63),
12483           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -4, 0, 0, 0, 0, 0,   -4,   8,    4,   2),
12484           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  4, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12485 
12486        /* 251-260 */
12487           new PlanetaryNutModel( 0, 1,-1, 2, 0, -5,  7,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   2),
12488           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -6, 0, 0, 0, 0, 0,    0,  31,    0,   0),
12489           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -5,   0,    1,   3),
12490           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -4,  6, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12491           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12492           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  6, 0, 0, 0, 0, 2,  -24, -13,   -6,  10),
12493           new PlanetaryNutModel( 0,-1, 1, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12494           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0, -32,  -17,   0),
12495           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 2,    8,  12,    5,  -3),
12496           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  9, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12497 
12498        /* 261-270 */
12499           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -9, 0, 0, 0, 0, 0,    7,  13,    0,   0),
12500           new PlanetaryNutModel( 0,-1, 1, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0,   -3,  16,    0,   0),
12501           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,   50,   0,    0, -27),
12502           new PlanetaryNutModel(-2, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -5,   -3,   0),
12503           new PlanetaryNutModel( 0,-2, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12504           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 1,    0,   5,    3,   1),
12505           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6, 10,  0, 0, 0, 0, 0, 2,   24,   5,    2, -11),
12506           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 2,    5, -11,   -5,  -2),
12507           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  3,  0, 0, 0, 0, 0, 1,   30,  -3,   -2, -16),
12508           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   18,   0,    0,  -9),
12509 
12510        /* 271-280 */
12511           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 0,    8, 614,    0,   0),
12512           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -3,  0, 0, 0, 0, 0, 1,    3,  -3,   -1,  -2),
12513           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    6,  17,    9,  -3),
12514           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0, -1,  0, 3, 0, 0, 0, 0,   -3,  -9,   -5,   2),
12515           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 1,    0,   6,    3,  -1),
12516           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 3, 0, 0, 0, 2, -127,  21,    9,  55),
12517           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -8, 0, 0, 0, 0, 0,    3,   5,    0,   0),
12518           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  8, 0, 0, 0, 0, 2,   -6, -10,   -4,   3),
12519           new PlanetaryNutModel( 0,-2, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    5,   0,    0,   0),
12520           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 2,   16,   9,    4,  -7),
12521 
12522        /* 281-290 */
12523           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  7, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12524           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -7, 0, 0, 0, 0, 0,    0,  22,    0,   0),
12525           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,  19,   10,   0),
12526           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,    7,   0,    0,  -4),
12527           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 10, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12528           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12529           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 4, 0, 0, 0, 2,   -9,   3,    1,   4),
12530           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 2,   17,   0,    0,  -7),
12531           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  5, 0, 0, 0, 0, 1,    0,  -3,   -2,  -1),
12532           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -5, 0, 0, 0, 0, 0,  -20,  34,    0,   0),
12533 
12534        /* 291-300 */
12535           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 1,  -10,   0,    1,   5),
12536           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -3,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   2),
12537           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -2,  0, 0, 0, 0, 0, 0,   22, -87,    0,   0),
12538           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12539           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  2,  0, 0, 0, 0, 0, 2,   -3,  -6,   -2,   1),
12540           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 2,  -16,  -3,   -1,   7),
12541           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 11,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12542           new PlanetaryNutModel( 0,-2, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12543           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -3, 0, 0, 0, 0, 0,  -68,  39,    0,   0),
12544           new PlanetaryNutModel( 0, 2,-2, 1, 0, -4,  4,  0, 0, 0, 0, 0, 0,   27,   0,    0, -14),
12545 
12546        /* 301-310 */
12547           new PlanetaryNutModel( 0,-1, 1, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12548           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -1, 0, 0, 0, 0, 0,  -25,   0,    0,   0),
12549           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 1,  -12,  -3,   -2,   6),
12550           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  6,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12551           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  7,  0, 0, 0, 0, 0, 2,    3,  66,   29,  -1),
12552           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 2,  490,   0,    0,-213),
12553           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,  -22,  93,   49,  12),
12554           new PlanetaryNutModel( 0, 1,-1, 1, 0, -4,  5,  0, 0, 0, 0, 0, 0,   -7,  28,   15,   4),
12555           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  6,  0, 0, 0, 0, 0, 1,   -3,  13,    7,   2),
12556           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -6,  0, 0, 0, 0, 0, 0,  -46,  14,    0,   0),
12557 
12558        /* 311-320 */
12559           new PlanetaryNutModel(-2, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12560           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  1, 0, 0, 0, 0, 0,    2,   1,    0,   0),
12561           new PlanetaryNutModel( 0,-1, 1, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12562           new PlanetaryNutModel( 0, 0, 0, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,  -28,   0,    0,  15),
12563           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12564           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1, -3, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12565           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  3, 0, 0, 0, 0, 2,  -11,   0,    0,   5),
12566           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -7, 12, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12567           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12568           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  1,  0, 0, 0, 0, 0, 1,   25, 106,   57, -13),
12569 
12570        /* 321-330 */
12571           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  0,  0, 0, 0, 0, 0, 0,    5,  21,   11,  -3),
12572           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0, 1485,   0,    0,   0),
12573           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 1,   -7, -32,  -17,   4),
12574           new PlanetaryNutModel( 0, 1,-1, 1, 0,  1, -2,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12575           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  5, 0, 0, 0, 0, 2,   -6,  -3,   -2,   3),
12576           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 4, 0, 0, 0, 2,   30,  -6,   -2, -13),
12577           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-4, 0, 0, 0, 0,   -4,   4,    0,   0),
12578           new PlanetaryNutModel( 0, 0, 0, 1, 0, -1,  1,  0, 0, 0, 0, 0, 0,  -19,   0,    0,  10),
12579           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 2,    0,   4,    2,  -1),
12580           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 10, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12581 
12582        /* 331-340 */
12583           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -3,  0, 3, 0, 0, 0, 0,    4,   0,    0,  -2),
12584           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  7, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12585           new PlanetaryNutModel(-2, 0, 2, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12586           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  8, 0, 0, 0, 0, 2,    5,   3,    1,  -2),
12587           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 0, 0, 0, 0, 0,    0,  11,    0,   0),
12588           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 2,  118,   0,    0, -52),
12589           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 3, 0, 0, 0, 1,    0,  -5,   -3,   0),
12590           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 0, 0, 0, 0,  -28,  36,    0,   0),
12591           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -4,  0, 0, 0, 0, 0, 0,    5,  -5,    0,   0),
12592           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 1,   14, -59,  -31,  -8),
12593 
12594        /* 341-350 */
12595           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   9,    5,   1),
12596           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  4,  0, 0, 0, 0, 0, 2, -458,   0,    0, 198),
12597           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 2,    0, -45,  -20,   0),
12598           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  9,  0, 0, 0, 0, 0, 1,    9,   0,    0,  -5),
12599           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -9,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12600           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-2, 0, 0, 0, 0,    0,  -4,   -2,  -1),
12601           new PlanetaryNutModel( 0, 2,-2, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,   11,   0,    0,  -6),
12602           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -4,  6, 0, 0, 0, 0, 2,    6,   0,    0,  -2),
12603           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -6, 0, 0, 0, 0, 0,  -16,  23,    0,   0),
12604           new PlanetaryNutModel( 0, 0, 0, 1, 0,  3, -4,  0, 0, 0, 0, 0, 0,    0,  -4,   -2,   0),
12605 
12606        /* 351-360 */
12607           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 2, 0, 0, 0, 2,   -5,   0,    0,   2),
12608           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 0, 0, 0, 0, -166, 269,    0,   0),
12609           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   15,   0,    0,  -8),
12610           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  9,  0, 0, 0, 0, 0, 2,   10,   0,    0,  -4),
12611           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -4, 0, 0, 0, 0, 0,  -78,  45,    0,   0),
12612           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 2,    0,  -5,   -2,   0),
12613           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  4,  0, 0, 0, 0, 0, 1,    7,   0,    0,  -4),
12614           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 0,   -5, 328,    0,   0),
12615           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -4,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12616           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2, -2, 0, 0, 0, 0, 0,    5,   0,    0,  -2),
12617 
12618        /* 361-370 */
12619           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 2, 0, 0, 0, 0,    0,   3,    1,   0),
12620           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-3, 0, 0, 0,   -3,   0,    0,   0),
12621           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-5, 0, 0, 0,   -3,   0,    0,   0),
12622           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 1,    0,  -4,   -2,   0),
12623           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,-1223, -26,    0,   0),
12624           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 1,    0,   7,    3,   0),
12625           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-3, 5, 0, 0, 0,    3,   0,    0,   0),
12626           new PlanetaryNutModel( 0, 0, 0, 1, 0, -3,  4,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
12627           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-2, 0, 0, 0,   -6,  20,    0,   0),
12628           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2, -2, 0, 0, 0, 0, 0, -368,   0,    0,   0),
12629 
12630        /* 371-380 */
12631           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0,-1, 0, 0, 0,  -75,   0,    0,   0),
12632           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,   11,   0,    0,  -6),
12633           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0, -2,  2, 0, 0, 0, 0, 0,    3,   0,    0,  -2),
12634           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 14,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12635           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2,-5, 0, 0, 0,  -13, -30,    0,   0),
12636           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 0,   21,   3,    0,   0),
12637           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -8, 3, 0, 0, 0, 2,   -3,   0,    0,   1),
12638           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12639           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    8, -27,    0,   0),
12640           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -8, 3, 0, 0, 0, 0,  -19, -11,    0,   0),
12641 
12642        /* 381-390 */
12643           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  8,-3, 0, 0, 0, 2,   -4,   0,    0,   2),
12644           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0,-2, 5, 0, 0, 2,    0,   5,    2,   0),
12645           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   2),
12646           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 12,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   0),
12647           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1,-2, 0, 0, 0,   -1,   0,    0,   0),
12648           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 1, 0, 0, 2,  -14,   0,    0,   6),
12649           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12650           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  2, 0, 0, 0, 0, 2,  -74,   0,    0,  32),
12651           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 0, 2, 0, 0, 2,    0,  -3,   -1,   0),
12652           new PlanetaryNutModel( 0, 2,-2, 1, 0, -5,  5,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12653 
12654        /* 391-400 */
12655           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 0,    8,  11,    0,   0),
12656           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 1,    0,   3,    2,   0),
12657           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 1, 0, 0, 0, 2, -262,   0,    0, 114),
12658           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -6,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12659           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 1,   -7,   0,    0,   4),
12660           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  6,  0, 0, 0, 0, 0, 2,    0, -27,  -12,   0),
12661           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  4, 0, 0, 0, 0, 2,  -19,  -8,   -4,   8),
12662           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 2,  202,   0,    0, -87),
12663           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  7,  0, 0, 0, 0, 0, 1,   -8,  35,   19,   5),
12664           new PlanetaryNutModel( 0, 1,-1, 1, 0, -5,  6,  0, 0, 0, 0, 0, 0,    0,   4,    2,   0),
12665 
12666        /* 401-410 */
12667           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -7,  0, 0, 0, 0, 0, 0,   16,  -5,    0,   0),
12668           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -1,  0, 1, 0, 0, 0, 0,    5,   0,    0,  -3),
12669           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  0, 1, 0, 0, 0, 0,    0,  -3,    0,   0),
12670           new PlanetaryNutModel( 0, 0, 0, 0,-1,  0,  3,  0, 0, 0, 0, 0, 2,    1,   0,    0,   0),
12671           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 2, 0, 0, 0, 2,  -35, -48,  -21,  15),
12672           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  6, 0, 0, 0, 0, 2,   -3,  -5,   -2,   1),
12673           new PlanetaryNutModel( 0, 0, 0, 1, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,  -3),
12674           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6,  9, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12675           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -9, 0, 0, 0, 0, 0,    0,  -5,    0,   0),
12676           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  2,  0, 0, 0, 0, 0, 1,   12,  55,   29,  -6),
12677 
12678        /* 411-420 */
12679           new PlanetaryNutModel( 0, 1,-1, 1, 0, -2,  1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12680           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0, -598,   0,    0,   0),
12681           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -2,  0, 0, 0, 0, 0, 1,   -3, -13,   -7,   1),
12682           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  0, 3, 0, 0, 0, 2,   -5,  -7,   -3,   2),
12683           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5,  7, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12684           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -7, 0, 0, 0, 0, 0,    5,  -7,    0,   0),
12685           new PlanetaryNutModel( 0, 0, 0, 1, 0, -2,  2,  0, 0, 0, 0, 0, 0,    4,   0,    0,  -2),
12686           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -5, 0, 0, 0, 0, 0,   16,  -6,    0,   0),
12687           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1, -3,  0, 0, 0, 0, 0, 0,    8,  -3,    0,   0),
12688           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 1,    8, -31,  -16,  -4),
12689 
12690        /* 421-430 */
12691           new PlanetaryNutModel( 0, 1,-1, 1, 0, -1,  2,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12692           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  3,  0, 0, 0, 0, 0, 2,  113,   0,    0, -49),
12693           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 2,    0, -24,  -10,   0),
12694           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7, 10,  0, 0, 0, 0, 0, 1,    4,   0,    0,  -2),
12695           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -3, 0, 0, 0, 0, 0,   27,   0,    0,   0),
12696           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  8,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12697           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12698           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  5,  0, 0, 0, 0, 0, 1,    5,   0,    0,  -2),
12699           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -5,  0, 0, 0, 0, 0, 0,    0,  -3,    0,   0),
12700           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  1, 0, 0, 0, 0, 2,  -13,   0,    0,   6),
12701 
12702        /* 431-440 */
12703           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 5, 0, 0, 0, 2,    5,   0,    0,  -2),
12704           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  3, 0, 0, 0, 0, 2,  -18, -10,   -4,   8),
12705           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 0,   -4, -28,    0,   0),
12706           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  0,  0, 0, 0, 0, 0, 2,   -5,   6,    3,   2),
12707           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 13,  0, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12708           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  5, 0, 0, 0, 0, 2,   -5,  -9,   -4,   2),
12709           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  0, 4, 0, 0, 0, 2,   17,   0,    0,  -7),
12710           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-4, 0, 0, 0, 0,   11,   4,    0,   0),
12711           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  7, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12712           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   83,  15,    0,   0),
12713 
12714        /* 441-450 */
12715           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 1,   -4,   0,    0,   2),
12716           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  5,  0, 0, 0, 0, 0, 2,    0,-114,  -49,   0),
12717           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 2,  117,   0,    0, -51),
12718           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  8,  0, 0, 0, 0, 0, 1,   -5,  19,   10,   2),
12719           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -8,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12720           new PlanetaryNutModel( 0, 0, 0, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
12721           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  9, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12722           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12723           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -6, 0, 0, 0, 0, 2,    0,  -6,   -2,   0),
12724           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  393,   3,    0,   0),
12725 
12726        /* 451-460 */
12727           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 1,   -4,  21,   11,   2),
12728           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 2,   -6,   0,   -1,   3),
12729           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5, 10,  0, 0, 0, 0, 0, 2,   -3,   8,    4,   1),
12730           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 0,    8,   0,    0,   0),
12731           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -4, 0, 0, 0, 0, 2,   18, -29,  -13,  -8),
12732           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  3,  0, 0, 0, 0, 0, 1,    8,  34,   18,  -4),
12733           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,   89,   0,    0,   0),
12734           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 1,    3,  12,    6,  -1),
12735           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 2,   54, -15,   -7, -24),
12736           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-3, 0, 0, 0,    0,   3,    0,   0),
12737 
12738        /* 461-470 */
12739           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 13, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12740           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 0,    0,  35,    0,   0),
12741           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-1, 0, 0, 0, 2, -154, -30,  -13,  67),
12742           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 0,   15,   0,    0,   0),
12743           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-2, 0, 0, 1,    0,   4,    2,   0),
12744           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12745           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -2, 0, 0, 0, 0, 2,   80, -71,  -31, -35),
12746           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0,-1, 0, 0, 2,    0, -20,   -9,   0),
12747           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 15, 0, 0, 0, 0, 2,   11,   5,    2,  -5),
12748           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 15,  0, 0, 0, 0, 0, 2,   61, -96,  -42, -27),
12749 
12750        /* 471-480 */
12751           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  9, -4, 0, 0, 0, 0, 2,   14,   9,    4,  -6),
12752           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2,-5, 0, 0, 2,  -11,  -6,   -3,   5),
12753           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-1,-5, 0, 0, 2,    0,  -3,   -1,   0),
12754           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 3, 0, 0, 0, 2,  123,-415, -180, -53),
12755           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,    0,   0,    0, -35),
12756           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12757           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    7, -32,  -17,  -4),
12758           new PlanetaryNutModel( 0, 1,-1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -9,   -5,   0),
12759           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 1,    0,  -4,    2,   0),
12760           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 0, 0, 0, 2,  -89,   0,    0,  38),
12761 
12762        /* 481-490 */
12763           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -6, 16,-4,-5, 0, 0, 2,    0, -86,  -19,  -6),
12764           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2,    0,   0,  -19,   6),
12765           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -2,  8,-3, 0, 0, 0, 2, -123,-416, -180,  53),
12766           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -8, 1, 5, 0, 0, 2,    0,  -3,   -1,   0),
12767           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 5, 0, 0, 2,   12,  -6,   -3,  -5),
12768           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -5,  4, 0, 0, 0, 0, 2,  -13,   9,    4,   6),
12769           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,    0, -15,   -7,   0),
12770           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12771           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 11,  0, 0, 0, 0, 0, 2,  -62, -97,  -42,  27),
12772           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, 11,  0, 0, 0, 0, 0, 2,  -11,   5,    2,   5),
12773 
12774        /* 491-500 */
12775           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 0, 1, 0, 0, 2,    0, -19,   -8,   0),
12776           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -3,  0, 2, 0, 0, 0, 2,   -3,   0,    0,   1),
12777           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   4,    2,   0),
12778           new PlanetaryNutModel( 0, 1,-1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12779           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   4,    2,   0),
12780           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  1,  2, 0, 0, 0, 0, 2,  -85, -70,  -31,  37),
12781           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 1, 0, 0, 0, 2,  163, -12,   -5, -72),
12782           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  7,  0, 0, 0, 0, 0, 2,  -63, -16,   -7,  28),
12783           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  4, 0, 0, 0, 0, 2,  -21, -32,  -14,   9),
12784           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 2,    0,  -3,   -1,   0),
12785 
12786        /* 501-510 */
12787           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  6,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -2),
12788           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 0,    0,   8,    0,   0),
12789           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -6,  0, 0, 0, 0, 0, 2,    3,  10,    4,  -1),
12790           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0, 2, 0, 0, 0, 2,    3,   0,    0,  -1),
12791           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  6, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12792           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -9, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12793           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 0,    6,  19,    0,   0),
12794           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2, -1,  0, 0, 0, 0, 0, 2,    5,-173,  -75,  -2),
12795           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -7, 0, 0, 0, 0, 2,    0,  -7,   -3,   0),
12796           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -5, 0, 0, 0, 0, 2,    7, -12,   -5,  -3),
12797 
12798        /* 511-520 */
12799           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 1,   -3,   0,    0,   2),
12800           new PlanetaryNutModel( 0, 0, 0, 0, 0, -1,  4,  0, 0, 0, 0, 0, 2,    3,  -4,   -2,  -1),
12801           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 2,   74,   0,    0, -32),
12802           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  9,  0, 0, 0, 0, 0, 1,   -3,  12,    6,   2),
12803           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -3, 0, 0, 0, 0, 2,   26, -14,   -6, -11),
12804           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3, -1, 0, 0, 0, 0, 2,   19,   0,    0,  -8),
12805           new PlanetaryNutModel( 0, 0, 0, 0, 0, -4,  4,  0, 0, 0, 0, 0, 1,    6,  24,   13,  -3),
12806           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 0,   83,   0,    0,   0),
12807           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 1,    0, -10,   -5,   0),
12808           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -4,  0, 0, 0, 0, 0, 2,   11,  -3,   -1,  -5),
12809 
12810        /* 521-530 */
12811           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  1, 0, 0, 0, 0, 2,    3,   0,    1,  -1),
12812           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -3,  0, 5, 0, 0, 0, 2,    3,   0,    0,  -1),
12813           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12814           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 1,    5, -23,  -12,  -3),
12815           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  1,  0, 0, 0, 0, 0, 2, -339,   0,    0, 147),
12816           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 12,  0, 0, 0, 0, 0, 2,    0, -10,   -5,   0),
12817           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-4, 0, 0, 0, 0,    5,   0,    0,   0),
12818           new PlanetaryNutModel( 0, 2,-2, 1, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12819           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 0, 0, 0, 0, 2,    0,  -4,   -2,   0),
12820           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 0,   18,  -3,    0,   0),
12821 
12822        /* 531-540 */
12823           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-3, 0, 0, 0, 2,    9, -11,   -5,  -4),
12824           new PlanetaryNutModel( 0, 0, 0, 0, 0, -2,  6,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12825           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  7,  0, 0, 0, 0, 0, 1,    3,   0,    0,  -1),
12826           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -7,  0, 0, 0, 0, 0, 0,    0,   9,    0,   0),
12827           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -6, 0, 0, 0, 0, 2,    6,  -9,   -4,  -2),
12828           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 0,   -4, -12,    0,   0),
12829           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-2, 0, 0, 0, 2,   67, -91,  -39, -29),
12830           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -4, 0, 0, 0, 0, 2,   30, -18,   -8, -13),
12831           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 0,    0,   0,    0,   0),
12832           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -2,  0, 0, 0, 0, 0, 2,    0,-114,  -50,   0),
12833 
12834        /* 541-550 */
12835           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,    0,   0,    0,  23),
12836           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0,-1, 0, 0, 0, 2,  517,  16,    7,-224),
12837           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-2, 0, 0, 2,    0,  -7,   -3,   0),
12838           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4, -2, 0, 0, 0, 0, 2,  143,  -3,   -1, -62),
12839           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0,-1, 0, 0, 2,   29,   0,    0, -13),
12840           new PlanetaryNutModel( 0, 2,-2, 1, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -4,   0,    0,   2),
12841           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 16,  0, 0, 0, 0, 0, 2,   -6,   0,    0,   3),
12842           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 2,-5, 0, 0, 2,    5,  12,    5,  -2),
12843           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -8, 3, 0, 0, 0, 2,  -25,   0,    0,  11),
12844           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -5, 16,-4,-5, 0, 0, 2,   -3,   0,    0,   1),
12845 
12846        /* 551-560 */
12847           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12848           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0, -1,  8,-3, 0, 0, 0, 2,  -22,  12,    5,  10),
12849           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,   50,   0,    0, -22),
12850           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12851           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8, 10,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12852           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  2, 0, 0, 0, 0, 2,   -4,   4,    2,   2),
12853           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  3,  0, 1, 0, 0, 0, 2,   -5, -11,   -5,   2),
12854           new PlanetaryNutModel( 0, 0, 0, 0, 0, -3,  8,  0, 0, 0, 0, 0, 2,    0,   4,    2,   0),
12855           new PlanetaryNutModel( 0, 0, 0, 0, 0, -5,  5,  0, 0, 0, 0, 0, 1,    4,  17,    9,  -2),
12856           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 0,   59,   0,    0,   0),
12857 
12858        /* 561-570 */
12859           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 1,    0,  -4,   -2,   0),
12860           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -5,  0, 0, 0, 0, 0, 2,   -8,   0,    0,   4),
12861           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12862           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 1,    4, -15,   -8,  -2),
12863           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  0,  0, 0, 0, 0, 0, 2,  370,  -8,    0,-160),
12864           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   0,   -3,   0),
12865           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  7, -7, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12866           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -5, 0, 0, 0, 0, 2,   -6,   3,    1,   3),
12867           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -8,  0, 0, 0, 0, 0, 0,    0,   6,    0,   0),
12868           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -3, 0, 0, 0, 0, 2,  -10,   0,    0,   4),
12869 
12870        /* 571-580 */
12871           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -3,  0, 0, 0, 0, 0, 2,    0,   9,    4,   0),
12872           new PlanetaryNutModel( 0, 0, 0, 0, 0,  1,  2,  0, 0, 0, 0, 0, 2,    4,  17,    7,  -2),
12873           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 2,   34,   0,    0, -15),
12874           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9, 11,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12875           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-4, 0, 0, 0, 2,   -5,   0,    0,   2),
12876           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-3, 0, 0, 0, 2,  -37,  -7,   -3,  16),
12877           new PlanetaryNutModel( 0, 0, 0, 0, 0, -6,  6,  0, 0, 0, 0, 0, 1,    3,  13,    7,  -2),
12878           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 0,   40,   0,    0,   0),
12879           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -6,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12880           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-2, 0, 0, 0, 2, -184,  -3,   -1,  80),
12881 
12882        /* 581-590 */
12883           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6, -4, 0, 0, 0, 0, 2,   -3,   0,    0,   1),
12884           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   0),
12885           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 1,    0, -10,   -6,  -1),
12886           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3, -1,  0, 0, 0, 0, 0, 2,   31,  -6,    0, -13),
12887           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0,-1, 0, 0, 0, 2,   -3, -32,  -14,   1),
12888           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0,-2, 0, 0, 2,   -7,   0,    0,   3),
12889           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5, -2, 0, 0, 0, 0, 2,    0,  -8,   -4,   0),
12890           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  4,  0, 0, 0, 0, 0, 0,    3,  -4,    0,   0),
12891           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -9,  0, 0, 0, 0, 0, 0,    0,   4,    0,   0),
12892           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -4,  0, 0, 0, 0, 0, 2,    0,   3,    1,   0),
12893 
12894        /* 591-600 */
12895           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 2,   19, -23,  -10,   2),
12896           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   0,    0, -10),
12897           new PlanetaryNutModel( 0, 0, 0, 0, 0,  2,  1,  0, 0, 0, 0, 0, 1,    0,   3,    2,   0),
12898           new PlanetaryNutModel( 0, 0, 0, 0, 0, -7,  7,  0, 0, 0, 0, 0, 1,    0,   9,    5,  -1),
12899           new PlanetaryNutModel( 0, 0, 0, 0, 0,  7, -7,  0, 0, 0, 0, 0, 0,   28,   0,    0,   0),
12900           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 1,    0,  -7,   -4,   0),
12901           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 2,    8,  -4,    0,  -4),
12902           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   0,   -2,   0),
12903           new PlanetaryNutModel( 0, 0, 0, 0, 0,  4, -2,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12904           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-4, 0, 0, 0, 2,   -3,   0,    0,   1),
12905 
12906        /* 601-610 */
12907           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-3, 0, 0, 0, 2,   -9,   0,    1,   4),
12908           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  5,  0,-2, 0, 0, 0, 2,    3,  12,    5,  -1),
12909           new PlanetaryNutModel( 0, 0, 0, 0, 0,  3,  0,  0, 0, 0, 0, 0, 2,   17,  -3,   -1,   0),
12910           new PlanetaryNutModel( 0, 0, 0, 0, 0, -8,  8,  0, 0, 0, 0, 0, 1,    0,   7,    4,   0),
12911           new PlanetaryNutModel( 0, 0, 0, 0, 0,  8, -8,  0, 0, 0, 0, 0, 0,   19,   0,    0,   0),
12912           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 1,    0,  -5,   -3,   0),
12913           new PlanetaryNutModel( 0, 0, 0, 0, 0,  5, -3,  0, 0, 0, 0, 0, 2,   14,  -3,    0,  -1),
12914           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,   -1,   0),
12915           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   0,    0,  -5),
12916           new PlanetaryNutModel( 0, 0, 0, 0, 0, -9,  9,  0, 0, 0, 0, 0, 1,    0,   5,    3,   0),
12917 
12918        /* 611-620 */
12919           new PlanetaryNutModel( 0, 0, 0, 0, 0,  9, -9,  0, 0, 0, 0, 0, 0,   13,   0,    0,   0),
12920           new PlanetaryNutModel( 0, 0, 0, 0, 0,  6, -4,  0, 0, 0, 0, 0, 1,    0,  -3,   -2,   0),
12921           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    2,   9,    4,   3),
12922           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    0,   0,    0,  -4),
12923           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    8,   0,    0,   0),
12924           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   4,    2,   0),
12925           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    6,   0,    0,  -3),
12926           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12927           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 1,    0,   3,    1,   0),
12928           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  6,  0, 0, 0, 0, 0, 2,    5,   0,    0,  -2),
12929 
12930        /* 621-630 */
12931           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 0, 2,    3,   0,    0,  -1),
12932           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
12933           new PlanetaryNutModel( 1, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    6,   0,    0,   0),
12934           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    7,   0,    0,   0),
12935           new PlanetaryNutModel( 1, 0,-2, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12936           new PlanetaryNutModel(-1, 0, 0, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12937           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,    6,   0,    0,   0),
12938           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
12939           new PlanetaryNutModel( 1, 0,-2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -4,    0,   0),
12940           new PlanetaryNutModel(-2, 0, 2, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    5,   0,    0,   0),
12941 
12942        /* 631-640 */
12943           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -3,   0,    0,   0),
12944           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
12945           new PlanetaryNutModel(-1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -5,   0,    0,   0),
12946           new PlanetaryNutModel(-1, 0, 2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    4,   0,    0,   0),
12947           new PlanetaryNutModel( 1,-1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    0,   0),
12948           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   13,   0,    0,   0),
12949           new PlanetaryNutModel(-2, 0, 0, 0, 0,  0,  2,  0,-3, 0, 0, 0, 0,   21,  11,    0,   0),
12950           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
12951           new PlanetaryNutModel(-1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,  -5,   -2,   0),
12952           new PlanetaryNutModel( 1, 1,-1, 1, 0,  0, -1,  0, 0, 0, 0, 0, 0,    0,   5,    3,   0),
12953 
12954        /* 641-650 */
12955           new PlanetaryNutModel(-1, 0, 0, 0, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,  -5,    0,   0),
12956           new PlanetaryNutModel(-1, 0, 2, 1, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   2),
12957           new PlanetaryNutModel( 0, 0, 0, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   20,  10,    0,   0),
12958           new PlanetaryNutModel(-1, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,  -34,   0,    0,   0),
12959           new PlanetaryNutModel(-1, 0, 2, 0, 0,  3, -3,  0, 0, 0, 0, 0, 0,  -19,   0,    0,   0),
12960           new PlanetaryNutModel( 1, 0,-2, 1, 0,  0, -2,  0, 2, 0, 0, 0, 0,    3,   0,    0,  -2),
12961           new PlanetaryNutModel( 1, 2,-2, 2, 0, -3,  3,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12962           new PlanetaryNutModel( 1, 2,-2, 2, 0,  0, -2,  0, 2, 0, 0, 0, 0,   -6,   0,    0,   3),
12963           new PlanetaryNutModel( 1, 0, 0, 0, 0,  1, -1,  0, 0, 0, 0, 0, 0,   -4,   0,    0,   0),
12964           new PlanetaryNutModel( 1, 0, 0, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    3,   0,    0,   0),
12965 
12966        /* 651-660 */
12967           new PlanetaryNutModel( 0, 0,-2, 0, 0,  2, -2,  0, 0, 0, 0, 0, 0,    3,   0,    0,   0),
12968           new PlanetaryNutModel( 0, 0,-2, 0, 0,  0,  1,  0,-1, 0, 0, 0, 0,    4,   0,    0,   0),
12969           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  2,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
12970           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    6,   0,    0,  -3),
12971           new PlanetaryNutModel( 0, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -8,   0,    0,   3),
12972           new PlanetaryNutModel( 0, 2, 0, 2, 0, -2,  3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12973           new PlanetaryNutModel( 0, 0, 2, 0, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   0),
12974           new PlanetaryNutModel( 0, 1, 1, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -3,   -2,   0),
12975           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  126, -63,  -27, -55),
12976           new PlanetaryNutModel(-1, 2, 0, 2, 0, 10, -3,  0, 0, 0, 0, 0, 0,   -5,   0,    1,   2),
12977 
12978        /* 661-670 */
12979           new PlanetaryNutModel( 0, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,   -3,  28,   15,   2),
12980           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,    5,   0,    1,  -2),
12981           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   9,    4,   1),
12982           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   9,    4,  -1),
12983           new PlanetaryNutModel(-1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0, -126, -63,  -27,  55),
12984           new PlanetaryNutModel( 2, 2,-2, 2, 0,  0, -2,  0, 3, 0, 0, 0, 0,    3,   0,    0,  -1),
12985           new PlanetaryNutModel( 1, 2, 0, 1, 0,  0, -2,  0, 3, 0, 0, 0, 0,   21, -11,   -6, -11),
12986           new PlanetaryNutModel( 0, 1, 1, 0, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,  -4,    0,   0),
12987           new PlanetaryNutModel(-1, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -21, -11,   -6,  11),
12988           new PlanetaryNutModel(-2, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   -3,   0,    0,   1),
12989 
12990        /* 671-680 */
12991           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -3,  0, 0, 0, 0, 0, 0,    0,   3,    1,   0),
12992           new PlanetaryNutModel( 0, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    8,   0,    0,  -4),
12993           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0,-1, 0, 0, 0, 0,   -6,   0,    0,   3),
12994           new PlanetaryNutModel( 0, 2, 0, 2, 0,  2, -2,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12995           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0, -1,  0, 1, 0, 0, 0, 0,    3,   0,    0,  -1),
12996           new PlanetaryNutModel( 1, 2, 0, 2, 0, -1,  1,  0, 0, 0, 0, 0, 0,   -3,   0,    0,   1),
12997           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   -5,   0,    0,   2),
12998           new PlanetaryNutModel( 2, 2, 0, 2, 0,  0,  2,  0,-3, 0, 0, 0, 0,   24, -12,   -5, -11),
12999           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0, -4,  8,-3, 0, 0, 0, 0,    0,   3,    1,   0),
13000           new PlanetaryNutModel( 1, 2, 0, 2, 0,  0,  4, -8, 3, 0, 0, 0, 0,    0,   3,    1,   0),
13001 
13002        /* 681-687 */
13003           new PlanetaryNutModel( 1, 1, 1, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    0,   3,    2,   0),
13004           new PlanetaryNutModel( 0, 2, 0, 2, 0,  0,  1,  0, 0, 0, 0, 0, 0,  -24, -12,   -5,  10),
13005           new PlanetaryNutModel( 2, 2, 0, 1, 0,  0,  1,  0, 0, 0, 0, 0, 0,    4,   0,   -1,  -2),
13006           new PlanetaryNutModel(-1, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,   13,   0,    0,  -6),
13007           new PlanetaryNutModel(-1, 2, 2, 2, 0,  3, -3,  0, 0, 0, 0, 0, 0,    7,   0,    0,  -3),
13008           new PlanetaryNutModel( 1, 2, 0, 2, 0,  1, -1,  0, 0, 0, 0, 0, 0,    3,   0,    0,  -1),
13009           new PlanetaryNutModel( 0, 2, 2, 2, 0,  0,  2,  0,-2, 0, 0, 0, 0,    3,   0,    0,  -1)
13010        };
13011 
13012     /* Number of terms in the planetary nutation model */
13013        final int NPL = xpl.length;
13014 
13015     /*--------------------------------------------------------------------*/
13016 
13017     /* Interval between fundamental date J2000.0 and given date (JC). */
13018        t = ((date1 - DJ00) + date2) / DJC;
13019 
13020     /* ------------------- */
13021     /* LUNI-SOLAR NUTATION */
13022     /* ------------------- */
13023 
13024     /* Fundamental (Delaunay) arguments */
13025 
13026     /* Mean anomaly of the Moon (IERS 2003). */
13027        el = jauFal03(t);
13028 
13029     /* Mean anomaly of the Sun (MHB2000). */
13030        elp = fmod(1287104.79305  +
13031                 t * (129596581.0481  +
13032                 t * (-0.5532  +
13033                 t * (0.000136  +
13034                 t * (-0.00001149)))), TURNAS) * DAS2R;
13035 
13036     /* Mean longitude of the Moon minus that of the ascending node */
13037     /* (IERS 2003. */
13038        f = jauFaf03(t);
13039 
13040     /* Mean elongation of the Moon from the Sun (MHB2000). */
13041        d = fmod(1072260.70369  +
13042               t * (1602961601.2090  +
13043               t * (-6.3706  +
13044               t * (0.006593  +
13045               t * (-0.00003169)))), TURNAS) * DAS2R;
13046 
13047     /* Mean longitude of the ascending node of the Moon (IERS 2003). */
13048        om = jauFaom03(t);
13049 
13050     /* Initialize the nutation values. */
13051        dp = 0.0;
13052        de = 0.0;
13053 
13054     /* Summation of luni-solar nutation series (in reverse order). */
13055        for (i = NLS-1; i >= 0; i--) {
13056 
13057        /* Argument and functions. */
13058           arg = fmod((double)xls[i].nl  * el +
13059                      (double)xls[i].nlp * elp +
13060                      (double)xls[i].nf  * f +
13061                      (double)xls[i].nd  * d +
13062                      (double)xls[i].nom * om, D2PI);
13063           sarg = sin(arg);
13064           carg = cos(arg);
13065 
13066        /* Term. */
13067           dp += (xls[i].sp + xls[i].spt * t) * sarg + xls[i].cp * carg;
13068           de += (xls[i].ce + xls[i].cet * t) * carg + xls[i].se * sarg;
13069        }
13070 
13071     /* Convert from 0.1 microarcsec units to radians. */
13072        dpsils = dp * U2R;
13073        depsls = de * U2R;
13074 
13075     /* ------------------ */
13076     /* PLANETARY NUTATION */
13077     /* ------------------ */
13078 
13079     /* n.b.  The MHB2000 code computes the luni-solar and planetary nutation */
13080     /* in different functions, using slightly different Delaunay */
13081     /* arguments in the two cases.  This behaviour is faithfully */
13082     /* reproduced here.  Use of the IERS 2003 expressions for both */
13083     /* cases leads to negligible changes, well below */
13084     /* 0.1 microarcsecond. */
13085 
13086     /* Mean anomaly of the Moon (MHB2000). */
13087        al = fmod(2.35555598 + 8328.6914269554 * t, D2PI);
13088 
13089     /* Mean longitude of the Moon minus that of the ascending node */
13090     /*(MHB2000). */
13091        af = fmod(1.627905234 + 8433.466158131 * t, D2PI);
13092 
13093     /* Mean elongation of the Moon from the Sun (MHB2000). */
13094        ad = fmod(5.198466741 + 7771.3771468121 * t, D2PI);
13095 
13096     /* Mean longitude of the ascending node of the Moon (MHB2000). */
13097        aom = fmod(2.18243920 - 33.757045 * t, D2PI);
13098 
13099     /* General accumulated precession in longitude (IERS 2003). */
13100        apa = jauFapa03(t);
13101 
13102     /* Planetary longitudes, Mercury through Uranus (IERS 2003). */
13103        alme = jauFame03(t);
13104        alve = jauFave03(t);
13105        alea = jauFae03(t);
13106        alma = jauFama03(t);
13107        alju = jauFaju03(t);
13108        alsa = jauFasa03(t);
13109        alur = jauFaur03(t);
13110 
13111     /* Neptune longitude (MHB2000). */
13112        alne = fmod(5.321159000 + 3.8127774000 * t, D2PI);
13113 
13114     /* Initialize the nutation values. */
13115        dp = 0.0;
13116        de = 0.0;
13117 
13118     /* Summation of planetary nutation series (in reverse order). */
13119        for (i = NPL-1; i >= 0; i--) {
13120 
13121        /* Argument and functions. */
13122           arg = fmod((double)xpl[i].nl  * al   +
13123                      (double)xpl[i].nf  * af   +
13124                      (double)xpl[i].nd  * ad   +
13125                      (double)xpl[i].nom * aom  +
13126                      (double)xpl[i].nme * alme +
13127                      (double)xpl[i].nve * alve +
13128                      (double)xpl[i].nea * alea +
13129                      (double)xpl[i].nma * alma +
13130                      (double)xpl[i].nju * alju +
13131                      (double)xpl[i].nsa * alsa +
13132                      (double)xpl[i].nur * alur +
13133                      (double)xpl[i].nne * alne +
13134                      (double)xpl[i].npa * apa, D2PI);
13135           sarg = sin(arg);
13136           carg = cos(arg);
13137 
13138        /* Term. */
13139           dp += (double)xpl[i].sp * sarg + (double)xpl[i].cp * carg;
13140           de += (double)xpl[i].se * sarg + (double)xpl[i].ce * carg;
13141 
13142        }
13143 
13144     /* Convert from 0.1 microarcsec units to radians. */
13145        dpsipl = dp * U2R;
13146        depspl = de * U2R;
13147 
13148     /* ------- */
13149     /* RESULTS */
13150     /* ------- */
13151 
13152     /* Add luni-solar and planetary components. */
13153        return new NutationTerms( dpsils + dpsipl,
13154                                depsls + depspl);
13155        }
13156     
13157 
13158     /**
13159     *  Nutation, IAU 2000B model.
13160     *
13161     *<p>This function is derived from the International Astronomical Union's
13162     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13163     *
13164     *<p>Status:  canonical model.
13165     *
13166     *<!-- Given: -->
13167     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13168     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13169     *
13170     *<!-- Returned: -->
13171     *     @return  nutation, luni-solar + planetary (Note 2)
13172     *
13173     * <p>Notes:
13174     * <ol>
13175     *
13176     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13177     *     convenient way between the two arguments.  For example,
13178     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13179     *     among others:
13180     *<pre>
13181     *            date1          date2
13182     *
13183     *         2450123.7           0.0       (JD method)
13184     *         2451545.0       -1421.3       (J2000 method)
13185     *         2400000.5       50123.2       (MJD method)
13186     *         2450123.5           0.2       (date &amp; time method)
13187     *</pre>
13188     *     The JD method is the most natural and convenient to use in
13189     *     cases where the loss of several decimal digits of resolution
13190     *     is acceptable.  The J2000 method is best matched to the way
13191     *     the argument is handled internally and will deliver the
13192     *     optimum resolution.  The MJD method and the date &amp; time methods
13193     *     are both good compromises between resolution and convenience.
13194     *
13195     * <li> The nutation components in longitude and obliquity are in radians
13196     *     and with respect to the equinox and ecliptic of date.  The
13197     *     obliquity at J2000.0 is assumed to be the Lieske et al. (1977)
13198     *     value of 84381.448 arcsec.  (The errors that result from using
13199     *     this function with the IAU 2006 value of 84381.406 arcsec can be
13200     *     neglected.)
13201     *
13202     *     The nutation model consists only of luni-solar terms, but
13203     *     includes also a fixed offset which compensates for certain long-
13204     *     period planetary terms (Note 7).
13205     *
13206     * <li> This function is an implementation of the IAU 2000B abridged
13207     *     nutation model formally adopted by the IAU General Assembly in
13208     *     2000.  The function computes the MHB_2000_SHORT luni-solar
13209     *     nutation series (Luzum 2001), but without the associated
13210     *     corrections for the precession rate adjustments and the offset
13211     *     between the GCRS and J2000.0 mean poles.
13212     *
13213     * <li> The full IAU 2000A (MHB2000) nutation model contains nearly 1400
13214     *     terms.  The IAU 2000B model (McCarthy &amp; Luzum 2003) contains only
13215     *     77 terms, plus additional simplifications, yet still delivers
13216     *     results of 1 mas accuracy at present epochs.  This combination of
13217     *     accuracy and size makes the IAU 2000B abridged nutation model
13218     *     suitable for most practical applications.
13219     *
13220     *     The function delivers a pole accurate to 1 mas from 1900 to 2100
13221     *     (usually better than 1 mas, very occasionally just outside
13222     *     1 mas).  The full IAU 2000A model, which is implemented in the
13223     *     function jauNut00a (q.v.), delivers considerably greater accuracy
13224     *     at current dates;  however, to realize this improved accuracy,
13225     *     corrections for the essentially unpredictable free-core-nutation
13226     *     (FCN) must also be included.
13227     *
13228     * <li> The present function provides classical nutation.  The
13229     *     MHB_2000_SHORT algorithm, from which it is adapted, deals also
13230     *     with (i) the offsets between the GCRS and mean poles and (ii) the
13231     *     adjustments in longitude and obliquity due to the changed
13232     *     precession rates.  These additional functions, namely frame bias
13233     *     and precession adjustments, are supported by the JSOFA functions
13234     *     jauBi00  and jauPr00.
13235     *
13236     * <li> The MHB_2000_SHORT algorithm also provides "total" nutations,
13237     *     comprising the arithmetic sum of the frame bias, precession
13238     *     adjustments, and nutation (luni-solar + planetary).  These total
13239     *     nutations can be used in combination with an existing IAU 1976
13240     *     precession implementation, such as jauPmat76,  to deliver GCRS-
13241     *     to-true predictions of mas accuracy at current epochs.  However,
13242     *     for symmetry with the jauNut00a  function (q.v. for the reasons),
13243     *     the JSOFA functions do not generate the "total nutations"
13244     *     directly.  Should they be required, they could of course easily
13245     *     be generated by calling jauBi00, jauPr00 and the present function
13246     *     and adding the results.
13247     *
13248     * <li> The IAU 2000B model includes "planetary bias" terms that are
13249     *     fixed in size but compensate for long-period nutations.  The
13250     *     amplitudes quoted in McCarthy &amp; Luzum (2003), namely
13251     *     Dpsi = -1.5835 mas and Depsilon = +1.6339 mas, are optimized for
13252     *     the "total nutations" method described in Note 6.  The Luzum
13253     *     (2001) values used in this JSOFA implementation, namely -0.135 mas
13254     *     and +0.388 mas, are optimized for the "rigorous" method, where
13255     *     frame bias, precession and nutation are applied separately and in
13256     *     that order.  During the interval 1995-2050, the JSOFA
13257     *     implementation delivers a maximum error of 1.001 mas (not
13258     *     including FCN).
13259     *</ol>
13260     *<p>References:
13261     *
13262     *     <p>Lieske, J.H., Lederle, T., Fricke, W., Morando, B., "Expressions
13263     *     for the precession quantities based upon the IAU /1976/ system of
13264     *     astronomical constants", Astron.Astrophys. 58, 1-2, 1-16. (1977)
13265     *
13266     *     <p>Luzum, B., private communication, 2001 (Fortran code
13267     *     MHB_2000_SHORT)
13268     *
13269     *     <p>McCarthy, D.D. &amp; Luzum, B.J., "An abridged model of the
13270     *     precession-nutation of the celestial pole", Cel.Mech.Dyn.Astron.
13271     *     85, 37-49 (2003)
13272     *
13273     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13274     *     Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994)
13275     *
13276     *@version 2009 December 17
13277     *
13278     *  @since Release 20101201
13279     *
13280     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13281     */
13282     public static NutationTerms jauNut00b(double date1, double date2)
13283     {
13284        double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
13285               dpsils, depsls, dpsipl, depspl;
13286        int i;
13287 
13288     /* Units of 0.1 microarcsecond to radians */
13289        final double U2R = DAS2R / 1e7;
13290 
13291     /* ---------------------------------------- */
13292     /* Fixed offsets in lieu of planetary terms */
13293     /* ---------------------------------------- */
13294 
13295        final double DPPLAN = -0.135 * DMAS2R;
13296        final double DEPLAN =  0.388 * DMAS2R;
13297 
13298     /* --------------------------------------------------- */
13299     /* Luni-solar nutation: argument and term coefficients */
13300     /* --------------------------------------------------- */
13301 
13302     /* The units for the sine and cosine coefficients are */
13303     /* 0.1 microarcsec and the same per Julian century    */
13304 
13305         final class LSNutationModel 
13306         {
13307           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13308           final double ps,pst,pc;     /* longitude sin, t*sin, cos coefficients */
13309           final double ec,ect,es;     /* obliquity cos, t*cos, sin coefficients */
13310           
13311           public LSNutationModel( int nl,int nlp,int nf,int nd,int nom,
13312           double ps, double pst, double pc,    
13313           double ec, double ect, double es    ) {
13314                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13315                this.ps = ps;this.pst = pst;this.pc = pc;    
13316                this.ec = ec;this.ect = ect; this.es= es;    
13317         }
13318 
13319        }
13320         LSNutationModel x[] = {
13321 
13322        /* 1-10 */
13323           new LSNutationModel( 0, 0, 0, 0,1,
13324              -172064161.0, -174666.0, 33386.0, 92052331.0, 9086.0, 15377.0),
13325           new LSNutationModel( 0, 0, 2,-2,2,
13326                -13170906.0, -1675.0, -13696.0, 5730336.0, -3015.0, -4587.0),
13327           new LSNutationModel( 0, 0, 2, 0,2,-2276413.0,-234.0, 2796.0, 978459.0,-485.0,1374.0),
13328           new LSNutationModel( 0, 0, 0, 0,2,2074554.0,  207.0, -698.0,-897492.0, 470.0,-291.0),
13329           new LSNutationModel( 0, 1, 0, 0,0,1475877.0,-3633.0,11817.0, 73871.0,-184.0,-1924.0),
13330           new LSNutationModel( 0, 1, 2,-2,2,-516821.0, 1226.0, -524.0, 224386.0,-677.0,-174.0),
13331           new LSNutationModel( 1, 0, 0, 0,0, 711159.0,   73.0, -872.0,  -6750.0,   0.0, 358.0),
13332           new LSNutationModel( 0, 0, 2, 0,1,-387298.0, -367.0,  380.0, 200728.0,  18.0, 318.0),
13333           new LSNutationModel( 1, 0, 2, 0,2,-301461.0,  -36.0,  816.0, 129025.0, -63.0, 367.0),
13334           new LSNutationModel( 0,-1, 2,-2,2, 215829.0, -494.0,  111.0, -95929.0, 299.0, 132.0),
13335 
13336        /* 11-20 */
13337           new LSNutationModel( 0, 0, 2,-2,1, 128227.0,  137.0,  181.0, -68982.0,  -9.0,  39.0),
13338           new LSNutationModel(-1, 0, 2, 0,2, 123457.0,   11.0,   19.0, -53311.0,  32.0,  -4.0),
13339           new LSNutationModel(-1, 0, 0, 2,0, 156994.0,   10.0, -168.0,  -1235.0,   0.0,  82.0),
13340           new LSNutationModel( 1, 0, 0, 0,1,  63110.0,   63.0,   27.0, -33228.0,   0.0,  -9.0),
13341           new LSNutationModel(-1, 0, 0, 0,1, -57976.0,  -63.0, -189.0,  31429.0,   0.0, -75.0),
13342           new LSNutationModel(-1, 0, 2, 2,2, -59641.0,  -11.0,  149.0,  25543.0, -11.0,  66.0),
13343           new LSNutationModel( 1, 0, 2, 0,1, -51613.0,  -42.0,  129.0,  26366.0,   0.0,  78.0),
13344           new LSNutationModel(-2, 0, 2, 0,1,  45893.0,   50.0,   31.0, -24236.0, -10.0,  20.0),
13345           new LSNutationModel( 0, 0, 0, 2,0,  63384.0,   11.0, -150.0,  -1220.0,   0.0,  29.0),
13346           new LSNutationModel( 0, 0, 2, 2,2, -38571.0,   -1.0,  158.0,  16452.0, -11.0,  68.0),
13347 
13348        /* 21-30 */
13349           new LSNutationModel( 0,-2, 2,-2,2,  32481.0,    0.0,    0.0, -13870.0,   0.0,   0.0),
13350           new LSNutationModel(-2, 0, 0, 2,0, -47722.0,    0.0,  -18.0,    477.0,   0.0, -25.0),
13351           new LSNutationModel( 2, 0, 2, 0,2, -31046.0,   -1.0,  131.0,  13238.0, -11.0,  59.0),
13352           new LSNutationModel( 1, 0, 2,-2,2,  28593.0,    0.0,   -1.0, -12338.0,  10.0,  -3.0),
13353           new LSNutationModel(-1, 0, 2, 0,1,  20441.0,   21.0,   10.0, -10758.0,   0.0,  -3.0),
13354           new LSNutationModel( 2, 0, 0, 0,0,  29243.0,    0.0,  -74.0,   -609.0,   0.0,  13.0),
13355           new LSNutationModel( 0, 0, 2, 0,0,  25887.0,    0.0,  -66.0,   -550.0,   0.0,  11.0),
13356           new LSNutationModel( 0, 1, 0, 0,1, -14053.0,  -25.0,   79.0,   8551.0,  -2.0, -45.0),
13357           new LSNutationModel(-1, 0, 0, 2,1,  15164.0,   10.0,   11.0,  -8001.0,   0.0,  -1.0),
13358           new LSNutationModel( 0, 2, 2,-2,2, -15794.0,   72.0,  -16.0,   6850.0, -42.0,  -5.0),
13359 
13360        /* 31-40 */
13361           new LSNutationModel( 0, 0,-2, 2,0,  21783.0,    0.0,   13.0,   -167.0,   0.0,  13.0),
13362           new LSNutationModel( 1, 0, 0,-2,1, -12873.0,  -10.0,  -37.0,   6953.0,   0.0, -14.0),
13363           new LSNutationModel( 0,-1, 0, 0,1, -12654.0,   11.0,   63.0,   6415.0,   0.0,  26.0),
13364           new LSNutationModel(-1, 0, 2, 2,1, -10204.0,    0.0,   25.0,   5222.0,   0.0,  15.0),
13365           new LSNutationModel( 0, 2, 0, 0,0,  16707.0,  -85.0,  -10.0,    168.0,  -1.0,  10.0),
13366           new LSNutationModel( 1, 0, 2, 2,2,  -7691.0,    0.0,   44.0,   3268.0,   0.0,  19.0),
13367           new LSNutationModel(-2, 0, 2, 0,0, -11024.0,    0.0,  -14.0,    104.0,   0.0,   2.0),
13368           new LSNutationModel( 0, 1, 2, 0,2,   7566.0,  -21.0,  -11.0,  -3250.0,   0.0,  -5.0),
13369           new LSNutationModel( 0, 0, 2, 2,1,  -6637.0,  -11.0,   25.0,   3353.0,   0.0,  14.0),
13370           new LSNutationModel( 0,-1, 2, 0,2,  -7141.0,   21.0,    8.0,   3070.0,   0.0,   4.0),
13371 
13372        /* 41-50 */
13373           new LSNutationModel( 0, 0, 0, 2,1,  -6302.0,  -11.0,    2.0,   3272.0,   0.0,   4.0),
13374           new LSNutationModel( 1, 0, 2,-2,1,   5800.0,   10.0,    2.0,  -3045.0,   0.0,  -1.0),
13375           new LSNutationModel( 2, 0, 2,-2,2,   6443.0,    0.0,   -7.0,  -2768.0,   0.0,  -4.0),
13376           new LSNutationModel(-2, 0, 0, 2,1,  -5774.0,  -11.0,  -15.0,   3041.0,   0.0,  -5.0),
13377           new LSNutationModel( 2, 0, 2, 0,1,  -5350.0,    0.0,   21.0,   2695.0,   0.0,  12.0),
13378           new LSNutationModel( 0,-1, 2,-2,1,  -4752.0,  -11.0,   -3.0,   2719.0,   0.0,  -3.0),
13379           new LSNutationModel( 0, 0, 0,-2,1,  -4940.0,  -11.0,  -21.0,   2720.0,   0.0,  -9.0),
13380           new LSNutationModel(-1,-1, 0, 2,0,   7350.0,    0.0,   -8.0,    -51.0,   0.0,   4.0),
13381           new LSNutationModel( 2, 0, 0,-2,1,   4065.0,    0.0,    6.0,  -2206.0,   0.0,   1.0),
13382           new LSNutationModel( 1, 0, 0, 2,0,   6579.0,    0.0,  -24.0,   -199.0,   0.0,   2.0),
13383 
13384        /* 51-60 */
13385           new LSNutationModel( 0, 1, 2,-2,1,   3579.0,    0.0,    5.0,  -1900.0,   0.0,   1.0),
13386           new LSNutationModel( 1,-1, 0, 0,0,   4725.0,    0.0,   -6.0,    -41.0,   0.0,   3.0),
13387           new LSNutationModel(-2, 0, 2, 0,2,  -3075.0,    0.0,   -2.0,   1313.0,   0.0,  -1.0),
13388           new LSNutationModel( 3, 0, 2, 0,2,  -2904.0,    0.0,   15.0,   1233.0,   0.0,   7.0),
13389           new LSNutationModel( 0,-1, 0, 2,0,   4348.0,    0.0,  -10.0,    -81.0,   0.0,   2.0),
13390           new LSNutationModel( 1,-1, 2, 0,2,  -2878.0,    0.0,    8.0,   1232.0,   0.0,   4.0),
13391           new LSNutationModel( 0, 0, 0, 1,0,  -4230.0,    0.0,    5.0,    -20.0,   0.0,  -2.0),
13392           new LSNutationModel(-1,-1, 2, 2,2,  -2819.0,    0.0,    7.0,   1207.0,   0.0,   3.0),
13393           new LSNutationModel(-1, 0, 2, 0,0,  -4056.0,    0.0,    5.0,     40.0,   0.0,  -2.0),
13394           new LSNutationModel( 0,-1, 2, 2,2,  -2647.0,    0.0,   11.0,   1129.0,   0.0,   5.0),
13395 
13396        /* 61-70 */
13397           new LSNutationModel(-2, 0, 0, 0,1,  -2294.0,    0.0,  -10.0,   1266.0,   0.0,  -4.0),
13398           new LSNutationModel( 1, 1, 2, 0,2,   2481.0,    0.0,   -7.0,  -1062.0,   0.0,  -3.0),
13399           new LSNutationModel( 2, 0, 0, 0,1,   2179.0,    0.0,   -2.0,  -1129.0,   0.0,  -2.0),
13400           new LSNutationModel(-1, 1, 0, 1,0,   3276.0,    0.0,    1.0,     -9.0,   0.0,   0.0),
13401           new LSNutationModel( 1, 1, 0, 0,0,  -3389.0,    0.0,    5.0,     35.0,   0.0,  -2.0),
13402           new LSNutationModel( 1, 0, 2, 0,0,   3339.0,    0.0,  -13.0,   -107.0,   0.0,   1.0),
13403           new LSNutationModel(-1, 0, 2,-2,1,  -1987.0,    0.0,   -6.0,   1073.0,   0.0,  -2.0),
13404           new LSNutationModel( 1, 0, 0, 0,2,  -1981.0,    0.0,    0.0,    854.0,   0.0,   0.0),
13405           new LSNutationModel(-1, 0, 0, 1,0,   4026.0,    0.0, -353.0,   -553.0,   0.0,-139.0),
13406           new LSNutationModel( 0, 0, 2, 1,2,   1660.0,    0.0,   -5.0,   -710.0,   0.0,  -2.0),
13407 
13408        /* 71-77 */
13409           new LSNutationModel(-1, 0, 2, 4,2,  -1521.0,    0.0,    9.0,    647.0,   0.0,   4.0),
13410           new LSNutationModel(-1, 1, 0, 1,1,   1314.0,    0.0,    0.0,   -700.0,   0.0,   0.0),
13411           new LSNutationModel( 0,-2, 2,-2,1,  -1283.0,    0.0,    0.0,    672.0,   0.0,   0.0),
13412           new LSNutationModel( 1, 0, 2, 2,1,  -1331.0,    0.0,    8.0,    663.0,   0.0,   4.0),
13413           new LSNutationModel(-2, 0, 2, 2,2,   1383.0,    0.0,   -2.0,   -594.0,   0.0,  -2.0),
13414           new LSNutationModel(-1, 0, 0, 0,2,   1405.0,    0.0,    4.0,   -610.0,   0.0,   2.0),
13415           new LSNutationModel( 1, 1, 2,-2,2,   1290.0,    0.0,    0.0,   -556.0,   0.0,   0.0)
13416        };
13417 
13418     /* Number of terms in the series */
13419        final int NLS = x.length;
13420 
13421     /*--------------------------------------------------------------------*/
13422 
13423     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13424        t = ((date1 - DJ00) + date2) / DJC;
13425 
13426     /* --------------------*/
13427     /* LUNI-SOLAR NUTATION */
13428     /* --------------------*/
13429 
13430     /* Fundamental (Delaunay) arguments from Simon et al. (1994) */
13431 
13432     /* Mean anomaly of the Moon. */
13433        el = fmod(485868.249036 + (1717915923.2178) * t, TURNAS) * DAS2R;
13434 
13435     /* Mean anomaly of the Sun. */
13436        elp = fmod(1287104.79305 + (129596581.0481) * t, TURNAS) * DAS2R;
13437 
13438     /* Mean argument of the latitude of the Moon. */
13439        f = fmod(335779.526232 + (1739527262.8478) * t, TURNAS) * DAS2R;
13440 
13441     /* Mean elongation of the Moon from the Sun. */
13442        d = fmod(1072260.70369 + (1602961601.2090) * t, TURNAS) * DAS2R;
13443 
13444     /* Mean longitude of the ascending node of the Moon. */
13445        om = fmod(450160.398036 + (-6962890.5431) * t, TURNAS) * DAS2R;
13446 
13447     /* Initialize the nutation values. */
13448        dp = 0.0;
13449        de = 0.0;
13450 
13451     /* Summation of luni-solar nutation series (smallest terms first). */
13452        for (i = NLS-1; i >= 0; i--) {
13453 
13454        /* Argument and functions. */
13455           arg = fmod( (double)x[i].nl  * el  +
13456                       (double)x[i].nlp * elp +
13457                       (double)x[i].nf  * f   +
13458                       (double)x[i].nd  * d   +
13459                       (double)x[i].nom * om, D2PI  );
13460           sarg = sin(arg);
13461           carg = cos(arg);
13462 
13463        /* Term. */
13464           dp += (x[i].ps + x[i].pst * t) * sarg + x[i].pc * carg;
13465           de += (x[i].ec + x[i].ect * t) * carg + x[i].es * sarg;
13466        }
13467 
13468     /* Convert from 0.1 microarcsec units to radians. */
13469        dpsils = dp * U2R;
13470        depsls = de * U2R;
13471 
13472     /* ------------------------------*/
13473     /* IN LIEU OF PLANETARY NUTATION */
13474     /* ------------------------------*/
13475 
13476     /* Fixed offset to correct for missing terms in truncated series. */
13477        dpsipl = DPPLAN;
13478        depspl = DEPLAN;
13479 
13480     /* --------*/
13481     /* RESULTS */
13482     /* --------*/
13483 
13484     /* Add luni-solar and planetary components. */
13485        return new NutationTerms(   dpsils + dpsipl,
13486                                 depsls + depspl);
13487 
13488     }
13489     
13490 
13491     /**
13492     *  IAU 2000A nutation with adjustments to match the IAU 2006
13493     *  precession.
13494     *
13495     *<!-- Given: -->
13496     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13497     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13498     *
13499     *<!-- Returned: -->
13500     *     @return  nutation, luni-solar + planetary (Note 2)
13501     *
13502     *<p>Status:  canonical model.
13503     *
13504     * <p>Notes:
13505     * <ol>
13506     *
13507     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13508     *     convenient way between the two arguments.  For example,
13509     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13510     *     among others:
13511     *<pre>
13512     *            date1          date2
13513     *
13514     *         2450123.7           0.0       (JD method)
13515     *         2451545.0       -1421.3       (J2000 method)
13516     *         2400000.5       50123.2       (MJD method)
13517     *         2450123.5           0.2       (date &amp; time method)
13518     *</pre>
13519     *     The JD method is the most natural and convenient to use in
13520     *     cases where the loss of several decimal digits of resolution
13521     *     is acceptable.  The J2000 method is best matched to the way
13522     *     the argument is handled internally and will deliver the
13523     *     optimum resolution.  The MJD method and the date &amp; time methods
13524     *     are both good compromises between resolution and convenience.
13525     *
13526     * <li> The nutation components in longitude and obliquity are in radians
13527     *     and with respect to the mean equinox and ecliptic of date,
13528     *     IAU 2006 precession model (Hilton et al. 2006, Capitaine et al.
13529     *     2005).
13530     *
13531     * <li> The function first computes the IAU 2000A nutation, then applies
13532     *     adjustments for (i) the consequences of the change in obliquity
13533     *     from the IAU 1980 ecliptic to the IAU 2006 ecliptic and (ii) the
13534     *     secular variation in the Earth's dynamical flattening.
13535     *
13536     * <li> The present function provides classical nutation, complementing
13537     *     the IAU 2000 frame bias and IAU 2006 precession.  It delivers a
13538     *     pole which is at current epochs accurate to a few tens of
13539     *     microarcseconds, apart from the free core nutation.
13540     *</ol>
13541     *<p>Called:<ul>
13542     *     <li>{@link #jauNut00a} nutation, IAU 2000A
13543     * </ul>
13544     *<p>References:
13545     *
13546     *     <p>Chapront, J., Chapront-Touze, M. &amp; Francou, G. 2002,
13547     *     Astron.Astrophys. 387, 700
13548     *
13549     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B. 1977,
13550     *     Astron.Astrophys. 58, 1-16
13551     *
13552     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A. 2002, J.Geophys.Res.
13553     *     107, B4.  The MHB_2000 code itself was obtained on 9th September
13554     *     2002 from ftp//maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
13555     *
13556     *     <p>Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
13557     *     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
13558     *
13559     *     <p>Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
13560     *     Astron.Astrophys.Supp.Ser. 135, 111
13561     *
13562     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
13563     *     Resolutions", in IERS Workshop 5.1 (2002)
13564     *
13565     *@version 2008 May 24
13566     *
13567     *  @since Release 20101201
13568     *
13569     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13570     */
13571     public static NutationTerms jauNut06a(double date1, double date2)
13572     {
13573        double t, fj2;
13574 
13575 
13576     /* Interval between fundamental date J2000.0 and given date (JC). */
13577        t = ((date1 - DJ00) + date2) / DJC;
13578 
13579     /* Factor correcting for secular variation of J2. */
13580        fj2 = -2.7774e-6 * t;
13581 
13582     /* Obtain IAU 2000A nutation. */
13583        NutationTerms nt = jauNut00a(date1, date2);
13584        
13585     /* Apply P03 adjustments (Wallace &amp; Capitaine, 2006, Eqs.5). */
13586        return new NutationTerms( nt.dpsi + nt.dpsi * (0.4697e-6 + fj2),
13587                                  nt.deps + nt.deps * fj2);
13588 
13589      }
13590     
13591     /**
13592     *  Nutation, IAU 1980 model.
13593     *
13594     *<p>This function is derived from the International Astronomical Union's
13595     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13596     *
13597     *<p>Status:  canonical model.
13598     *
13599     *<!-- Given: -->
13600     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13601     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13602     *
13603     *<!-- Returned: -->
13604     *     @return dpsi           double      <u>returned</u> nutation in longitude (radians)
13605     *             deps           double      <u>returned</u> nutation in obliquity (radians)
13606     *
13607     * <p>Notes:
13608     * <ol>
13609     *
13610     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13611     *     convenient way between the two arguments.  For example,
13612     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13613     *     among others:
13614     *<pre>
13615     *            date1          date2
13616     *
13617     *         2450123.7           0.0       (JD method)
13618     *         2451545.0       -1421.3       (J2000 method)
13619     *         2400000.5       50123.2       (MJD method)
13620     *         2450123.5           0.2       (date &amp; time method)
13621     *</pre>
13622     *     The JD method is the most natural and convenient to use in
13623     *     cases where the loss of several decimal digits of resolution
13624     *     is acceptable.  The J2000 method is best matched to the way
13625     *     the argument is handled internally and will deliver the
13626     *     optimum resolution.  The MJD method and the date &amp; time methods
13627     *     are both good compromises between resolution and convenience.
13628     *
13629     * <li> The nutation components are with respect to the ecliptic of
13630     *     date.
13631     *</ol>
13632     *<p>Called:<ul>
13633     *     <li>{@link #jauAnpm} normalize angle into range +/- pi
13634     * </ul>
13635     *<p>Reference:
13636     *
13637     *     <p>Explanatory Supplement to the Astronomical Almanac,
13638     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
13639     *     Section 3.222 (p111).
13640     *
13641     *@version 2008 September 30
13642     *
13643     *  @since Release 20101201
13644     *
13645     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13646     */
13647     public static NutationTerms jauNut80(double date1, double date2)
13648     {
13649        double t, el, elp, f, d, om, dp, de, arg, s, c;
13650        int j;
13651 
13652     /* Units of 0.1 milliarcsecond to radians */
13653        final double U2R = DAS2R / 1e4;
13654 
13655     /* ------------------------------------------------ */
13656     /* Table of multiples of arguments and coefficients */
13657     /* ------------------------------------------------ */
13658 
13659     /* The units for the sine and cosine coefficients are 0.1 mas and */
13660     /* the same per Julian century */
13661 
13662        final class NutationModel {
13663           final int nl,nlp,nf,nd,nom; /* coefficients of l,l',F,D,Om */
13664           final double sp,spt;        /* longitude sine, 1 and t coefficients */
13665           final double ce,cet;        /* obliquity cosine, 1 and t coefficients */
13666           
13667           public NutationModel(int nl,int nlp,int nf,int nd,int nom,
13668           double sp,double spt,       
13669           double ce,double cet       ) {
13670                this.nl = nl;this.nlp = nlp;this.nf = nf;this.nd = nd;this.nom = nom;
13671                this.sp = sp;this.spt = spt;      
13672                this.ce = ce;this.cet = cet;     
13673         }
13674        }
13675        NutationModel x[] = {
13676 
13677        /* 1-10 */
13678           new NutationModel(  0,  0,  0,  0,  1, -171996.0, -174.2,  92025.0,    8.9 ),
13679           new NutationModel(  0,  0,  0,  0,  2,    2062.0,    0.2,   -895.0,    0.5 ),
13680           new NutationModel( -2,  0,  2,  0,  1,      46.0,    0.0,    -24.0,    0.0 ),
13681           new NutationModel(  2,  0, -2,  0,  0,      11.0,    0.0,      0.0,    0.0 ),
13682           new NutationModel( -2,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13683           new NutationModel(  1, -1,  0, -1,  0,      -3.0,    0.0,      0.0,    0.0 ),
13684           new NutationModel(  0, -2,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13685           new NutationModel(  2,  0, -2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13686           new NutationModel(  0,  0,  2, -2,  2,  -13187.0,   -1.6,   5736.0,   -3.1 ),
13687           new NutationModel(  0,  1,  0,  0,  0,    1426.0,   -3.4,     54.0,   -0.1 ),
13688 
13689        /* 11-20 */
13690           new NutationModel(  0,  1,  2, -2,  2,    -517.0,    1.2,    224.0,   -0.6 ),
13691           new NutationModel(  0, -1,  2, -2,  2,     217.0,   -0.5,    -95.0,    0.3 ),
13692           new NutationModel(  0,  0,  2, -2,  1,     129.0,    0.1,    -70.0,    0.0 ),
13693           new NutationModel(  2,  0,  0, -2,  0,      48.0,    0.0,      1.0,    0.0 ),
13694           new NutationModel(  0,  0,  2, -2,  0,     -22.0,    0.0,      0.0,    0.0 ),
13695           new NutationModel(  0,  2,  0,  0,  0,      17.0,   -0.1,      0.0,    0.0 ),
13696           new NutationModel(  0,  1,  0,  0,  1,     -15.0,    0.0,      9.0,    0.0 ),
13697           new NutationModel(  0,  2,  2, -2,  2,     -16.0,    0.1,      7.0,    0.0 ),
13698           new NutationModel(  0, -1,  0,  0,  1,     -12.0,    0.0,      6.0,    0.0 ),
13699           new NutationModel( -2,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13700 
13701        /* 21-30 */
13702           new NutationModel(  0, -1,  2, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13703           new NutationModel(  2,  0,  0, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13704           new NutationModel(  0,  1,  2, -2,  1,       4.0,    0.0,     -2.0,    0.0 ),
13705           new NutationModel(  1,  0,  0, -1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13706           new NutationModel(  2,  1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13707           new NutationModel(  0,  0, -2,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13708           new NutationModel(  0,  1, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13709           new NutationModel(  0,  1,  0,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13710           new NutationModel( -1,  0,  0,  1,  1,       1.0,    0.0,      0.0,    0.0 ),
13711           new NutationModel(  0,  1,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13712 
13713        /* 31-40 */
13714           new NutationModel(  0,  0,  2,  0,  2,   -2274.0,   -0.2,    977.0,   -0.5 ),
13715           new NutationModel(  1,  0,  0,  0,  0,     712.0,    0.1,     -7.0,    0.0 ),
13716           new NutationModel(  0,  0,  2,  0,  1,    -386.0,   -0.4,    200.0,    0.0 ),
13717           new NutationModel(  1,  0,  2,  0,  2,    -301.0,    0.0,    129.0,   -0.1 ),
13718           new NutationModel(  1,  0,  0, -2,  0,    -158.0,    0.0,     -1.0,    0.0 ),
13719           new NutationModel( -1,  0,  2,  0,  2,     123.0,    0.0,    -53.0,    0.0 ),
13720           new NutationModel(  0,  0,  0,  2,  0,      63.0,    0.0,     -2.0,    0.0 ),
13721           new NutationModel(  1,  0,  0,  0,  1,      63.0,    0.1,    -33.0,    0.0 ),
13722           new NutationModel( -1,  0,  0,  0,  1,     -58.0,   -0.1,     32.0,    0.0 ),
13723           new NutationModel( -1,  0,  2,  2,  2,     -59.0,    0.0,     26.0,    0.0 ),
13724 
13725        /* 41-50 */
13726           new NutationModel(  1,  0,  2,  0,  1,     -51.0,    0.0,     27.0,    0.0 ),
13727           new NutationModel(  0,  0,  2,  2,  2,     -38.0,    0.0,     16.0,    0.0 ),
13728           new NutationModel(  2,  0,  0,  0,  0,      29.0,    0.0,     -1.0,    0.0 ),
13729           new NutationModel(  1,  0,  2, -2,  2,      29.0,    0.0,    -12.0,    0.0 ),
13730           new NutationModel(  2,  0,  2,  0,  2,     -31.0,    0.0,     13.0,    0.0 ),
13731           new NutationModel(  0,  0,  2,  0,  0,      26.0,    0.0,     -1.0,    0.0 ),
13732           new NutationModel( -1,  0,  2,  0,  1,      21.0,    0.0,    -10.0,    0.0 ),
13733           new NutationModel( -1,  0,  0,  2,  1,      16.0,    0.0,     -8.0,    0.0 ),
13734           new NutationModel(  1,  0,  0, -2,  1,     -13.0,    0.0,      7.0,    0.0 ),
13735           new NutationModel( -1,  0,  2,  2,  1,     -10.0,    0.0,      5.0,    0.0 ),
13736 
13737        /* 51-60 */
13738           new NutationModel(  1,  1,  0, -2,  0,      -7.0,    0.0,      0.0,    0.0 ),
13739           new NutationModel(  0,  1,  2,  0,  2,       7.0,    0.0,     -3.0,    0.0 ),
13740           new NutationModel(  0, -1,  2,  0,  2,      -7.0,    0.0,      3.0,    0.0 ),
13741           new NutationModel(  1,  0,  2,  2,  2,      -8.0,    0.0,      3.0,    0.0 ),
13742           new NutationModel(  1,  0,  0,  2,  0,       6.0,    0.0,      0.0,    0.0 ),
13743           new NutationModel(  2,  0,  2, -2,  2,       6.0,    0.0,     -3.0,    0.0 ),
13744           new NutationModel(  0,  0,  0,  2,  1,      -6.0,    0.0,      3.0,    0.0 ),
13745           new NutationModel(  0,  0,  2,  2,  1,      -7.0,    0.0,      3.0,    0.0 ),
13746           new NutationModel(  1,  0,  2, -2,  1,       6.0,    0.0,     -3.0,    0.0 ),
13747           new NutationModel(  0,  0,  0, -2,  1,      -5.0,    0.0,      3.0,    0.0 ),
13748 
13749        /* 61-70 */
13750           new NutationModel(  1, -1,  0,  0,  0,       5.0,    0.0,      0.0,    0.0 ),
13751           new NutationModel(  2,  0,  2,  0,  1,      -5.0,    0.0,      3.0,    0.0 ),
13752           new NutationModel(  0,  1,  0, -2,  0,      -4.0,    0.0,      0.0,    0.0 ),
13753           new NutationModel(  1,  0, -2,  0,  0,       4.0,    0.0,      0.0,    0.0 ),
13754           new NutationModel(  0,  0,  0,  1,  0,      -4.0,    0.0,      0.0,    0.0 ),
13755           new NutationModel(  1,  1,  0,  0,  0,      -3.0,    0.0,      0.0,    0.0 ),
13756           new NutationModel(  1,  0,  2,  0,  0,       3.0,    0.0,      0.0,    0.0 ),
13757           new NutationModel(  1, -1,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13758           new NutationModel( -1, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13759           new NutationModel( -2,  0,  0,  0,  1,      -2.0,    0.0,      1.0,    0.0 ),
13760 
13761        /* 71-80 */
13762           new NutationModel(  3,  0,  2,  0,  2,      -3.0,    0.0,      1.0,    0.0 ),
13763           new NutationModel(  0, -1,  2,  2,  2,      -3.0,    0.0,      1.0,    0.0 ),
13764           new NutationModel(  1,  1,  2,  0,  2,       2.0,    0.0,     -1.0,    0.0 ),
13765           new NutationModel( -1,  0,  2, -2,  1,      -2.0,    0.0,      1.0,    0.0 ),
13766           new NutationModel(  2,  0,  0,  0,  1,       2.0,    0.0,     -1.0,    0.0 ),
13767           new NutationModel(  1,  0,  0,  0,  2,      -2.0,    0.0,      1.0,    0.0 ),
13768           new NutationModel(  3,  0,  0,  0,  0,       2.0,    0.0,      0.0,    0.0 ),
13769           new NutationModel(  0,  0,  2,  1,  2,       2.0,    0.0,     -1.0,    0.0 ),
13770           new NutationModel( -1,  0,  0,  0,  2,       1.0,    0.0,     -1.0,    0.0 ),
13771           new NutationModel(  1,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13772 
13773        /* 81-90 */
13774           new NutationModel( -2,  0,  2,  2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13775           new NutationModel( -1,  0,  2,  4,  2,      -2.0,    0.0,      1.0,    0.0 ),
13776           new NutationModel(  2,  0,  0, -4,  0,      -1.0,    0.0,      0.0,    0.0 ),
13777           new NutationModel(  1,  1,  2, -2,  2,       1.0,    0.0,     -1.0,    0.0 ),
13778           new NutationModel(  1,  0,  2,  2,  1,      -1.0,    0.0,      1.0,    0.0 ),
13779           new NutationModel( -2,  0,  2,  4,  2,      -1.0,    0.0,      1.0,    0.0 ),
13780           new NutationModel( -1,  0,  4,  0,  2,       1.0,    0.0,      0.0,    0.0 ),
13781           new NutationModel(  1, -1,  0, -2,  0,       1.0,    0.0,      0.0,    0.0 ),
13782           new NutationModel(  2,  0,  2, -2,  1,       1.0,    0.0,     -1.0,    0.0 ),
13783           new NutationModel(  2,  0,  2,  2,  2,      -1.0,    0.0,      0.0,    0.0 ),
13784 
13785        /* 91-100 */
13786           new NutationModel(  1,  0,  0,  2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13787           new NutationModel(  0,  0,  4, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13788           new NutationModel(  3,  0,  2, -2,  2,       1.0,    0.0,      0.0,    0.0 ),
13789           new NutationModel(  1,  0,  2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13790           new NutationModel(  0,  1,  2,  0,  1,       1.0,    0.0,      0.0,    0.0 ),
13791           new NutationModel( -1, -1,  0,  2,  1,       1.0,    0.0,      0.0,    0.0 ),
13792           new NutationModel(  0,  0, -2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13793           new NutationModel(  0,  0,  2, -1,  2,      -1.0,    0.0,      0.0,    0.0 ),
13794           new NutationModel(  0,  1,  0,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13795           new NutationModel(  1,  0, -2, -2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13796 
13797        /* 101-106 */
13798           new NutationModel(  0, -1,  2,  0,  1,      -1.0,    0.0,      0.0,    0.0 ),
13799           new NutationModel(  1,  1,  0, -2,  1,      -1.0,    0.0,      0.0,    0.0 ),
13800           new NutationModel(  1,  0, -2,  2,  0,      -1.0,    0.0,      0.0,    0.0 ),
13801           new NutationModel(  2,  0,  0,  2,  0,       1.0,    0.0,      0.0,    0.0 ),
13802           new NutationModel(  0,  0,  2,  4,  2,      -1.0,    0.0,      0.0,    0.0 ),
13803           new NutationModel(  0,  1,  0,  1,  0,       1.0,    0.0,      0.0,    0.0 )
13804        };
13805 
13806     /* Number of terms in the series */
13807        final int NT = x.length;
13808 
13809     /*--------------------------------------------------------------------*/
13810 
13811     /* Interval between fundamental epoch J2000.0 and given date (JC). */
13812        t = ((date1 - DJ00) + date2) / DJC;
13813 
13814     /* --------------------- */
13815     /* Fundamental arguments */
13816     /* --------------------- */
13817 
13818     /* Mean longitude of Moon minus mean longitude of Moon's perigee. */
13819        el = jauAnpm(
13820             (485866.733 + (715922.633 + (31.310 + 0.064 * t) * t) * t)
13821             * DAS2R + fmod(1325.0 * t, 1.0) * D2PI);
13822 
13823     /* Mean longitude of Sun minus mean longitude of Sun's perigee. */
13824        elp = jauAnpm(
13825              (1287099.804 + (1292581.224 + (-0.577 - 0.012 * t) * t) * t)
13826              * DAS2R + fmod(99.0 * t, 1.0) * D2PI);
13827 
13828     /* Mean longitude of Moon minus mean longitude of Moon's node. */
13829        f = jauAnpm(
13830            (335778.877 + (295263.137 + (-13.257 + 0.011 * t) * t) * t)
13831            * DAS2R + fmod(1342.0 * t, 1.0) * D2PI);
13832 
13833     /* Mean elongation of Moon from Sun. */
13834        d = jauAnpm(
13835            (1072261.307 + (1105601.328 + (-6.891 + 0.019 * t) * t) * t)
13836            * DAS2R + fmod(1236.0 * t, 1.0) * D2PI);
13837 
13838     /* Longitude of the mean ascending node of the lunar orbit on the */
13839     /* ecliptic, measured from the mean equinox of date. */
13840        om = jauAnpm(
13841             (450160.280 + (-482890.539 + (7.455 + 0.008 * t) * t) * t)
13842             * DAS2R + fmod(-5.0 * t, 1.0) * D2PI);
13843 
13844     /* --------------- */
13845     /* Nutation series */
13846     /* --------------- */
13847 
13848     /* Initialize nutation components. */
13849        dp = 0.0;
13850        de = 0.0;
13851 
13852     /* Sum the nutation terms, ending with the biggest. */
13853        for (j = NT-1; j >= 0; j--) {
13854 
13855        /* Form argument for current term. */
13856           arg = (double)x[j].nl  * el
13857               + (double)x[j].nlp * elp
13858               + (double)x[j].nf  * f
13859               + (double)x[j].nd  * d
13860               + (double)x[j].nom * om;
13861 
13862        /* Accumulate current nutation term. */
13863           s = x[j].sp + x[j].spt * t;
13864           c = x[j].ce + x[j].cet * t;
13865           if (s != 0.0) dp += s * sin(arg);
13866           if (c != 0.0) de += c * cos(arg);
13867        }
13868 
13869     /* Convert results from 0.1 mas units to radians. */
13870        return new NutationTerms( dp * U2R,
13871                                  de * U2R);
13872 
13873         }
13874     
13875 
13876     /**
13877     *  Form the matrix of nutation for a given date, IAU 1980 model.
13878     *
13879     *<p>This function is derived from the International Astronomical Union's
13880     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13881     *
13882     *<p>Status:  support function.
13883     *
13884     *<!-- Given: -->
13885     *     @param date1 double           TDB date (Note 1)
13886     *     @param date2 double           TDB date (Note 1) 
13887     *
13888     *<!-- Returned: -->
13889     *     @return           double[3][3]       nutation matrix
13890     *
13891     * <p>Notes:
13892     * <ol>
13893     *
13894     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13895     *     convenient way between the two arguments.  For example,
13896     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13897     *     among others:
13898     *<pre>
13899     *            date1          date2
13900     *
13901     *         2450123.7           0.0       (JD method)
13902     *         2451545.0       -1421.3       (J2000 method)
13903     *         2400000.5       50123.2       (MJD method)
13904     *         2450123.5           0.2       (date &amp; time method)
13905     *</pre>
13906     *     The JD method is the most natural and convenient to use in
13907     *     cases where the loss of several decimal digits of resolution
13908     *     is acceptable.  The J2000 method is best matched to the way
13909     *     the argument is handled internally and will deliver the
13910     *     optimum resolution.  The MJD method and the date &amp; time methods
13911     *     are both good compromises between resolution and convenience.
13912     *
13913     * <li> The matrix operates in the sense V(true) = rmatn * V(mean),
13914     *     where the p-vector V(true) is with respect to the true
13915     *     equatorial triad of date and the p-vector V(mean) is with
13916     *     respect to the mean equatorial triad of date.
13917     *</ol>
13918     *<p>Called:<ul>
13919     *     <li>{@link #jauNut80} nutation, IAU 1980
13920     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
13921     *     <li>{@link #jauNumat} form nutation matrix
13922     * </ul>
13923     *@version 2008 May 12
13924     *
13925     *  @since Release 20101201
13926     *
13927     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13928     */
13929     public static double[][] jauNutm80(double date1, double date2)
13930     {
13931         double rmatn[][];
13932     /* Nutation components and mean obliquity. */
13933        NutationTerms nt = jauNut80(date1, date2);
13934        double epsa = jauObl80(date1, date2);
13935 
13936     /* Build the rotation matrix. */
13937        rmatn = jauNumat(epsa, nt.dpsi, nt.deps);
13938 
13939        return rmatn;
13940 
13941         }
13942     
13943 
13944     /**
13945     *  Mean obliquity of the ecliptic, IAU 2006 precession model.
13946     *
13947     *<p>This function is derived from the International Astronomical Union's
13948     *  SOFA (Standards Of Fundamental Astronomy) software collection.
13949     *
13950     *<p>Status:  canonical model.
13951     *
13952     *<!-- Given: -->
13953     *     @param date1 double TT as a 2-part Julian Date (Note 1)
13954     *     @param date2 double TT as a 2-part Julian Date (Note 1)
13955     *
13956     * <!-- Returned (function value): -->
13957     *  @return double   obliquity of the ecliptic (radians, Note 2)
13958     *
13959     * <p>Notes:
13960     * <ol>
13961     *
13962     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
13963     *     convenient way between the two arguments.  For example,
13964     *     JD(TT)=2450123.7 could be expressed in any of these ways,
13965     *     among others:
13966     *<pre>
13967     *            date1          date2
13968     *
13969     *         2450123.7           0.0       (JD method)
13970     *         2451545.0       -1421.3       (J2000 method)
13971     *         2400000.5       50123.2       (MJD method)
13972     *         2450123.5           0.2       (date &amp; time method)
13973     *</pre>
13974     *     The JD method is the most natural and convenient to use in
13975     *     cases where the loss of several decimal digits of resolution
13976     *     is acceptable.  The J2000 method is best matched to the way
13977     *     the argument is handled internally and will deliver the
13978     *     optimum resolution.  The MJD method and the date &amp; time methods
13979     *     are both good compromises between resolution and convenience.
13980     *
13981     * <li> The result is the angle between the ecliptic and mean equator of
13982     *     date date1+date2.
13983     *</ol>
13984     *<p>Reference:
13985     *
13986     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
13987     *
13988     *@version 2009 March 16
13989     *
13990     *  @since Release 20101201
13991     *
13992     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
13993     */
13994     public static double jauObl06(double date1, double date2)
13995     {
13996        double t, eps0;
13997 
13998 
13999     /* Interval between fundamental date J2000.0 and given date (JC). */
14000        t = ((date1 - DJ00) + date2) / DJC;
14001 
14002     /* Mean obliquity. */
14003        eps0 = (84381.406     +
14004               (-46.836769    +
14005               ( -0.0001831   +
14006               (  0.00200340  +
14007               ( -0.000000576 +
14008               ( -0.0000000434) * t) * t) * t) * t) * t) * DAS2R;
14009 
14010        return eps0;
14011 
14012         }
14013     
14014 
14015     /**
14016     *  Mean obliquity of the ecliptic, IAU 1980 model.
14017     *
14018     *<p>This function is derived from the International Astronomical Union's
14019     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14020     *
14021     *<p>Status:  canonical model.
14022     *
14023     *<!-- Given: -->
14024     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14025     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14026     *
14027     * <!-- Returned (function value): -->
14028     *  @return double    obliquity of the ecliptic (radians, Note 2)
14029     *
14030     * <p>Notes:
14031     * <ol>
14032     *
14033     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14034     *     convenient way between the two arguments.  For example,
14035     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14036     *     among others:
14037     *<pre>
14038     *            date1          date2
14039     *
14040     *         2450123.7           0.0       (JD method)
14041     *         2451545.0       -1421.3       (J2000 method)
14042     *         2400000.5       50123.2       (MJD method)
14043     *         2450123.5           0.2       (date &amp; time method)
14044     *</pre>
14045     *     The JD method is the most natural and convenient to use in
14046     *     cases where the loss of several decimal digits of resolution
14047     *     is acceptable.  The J2000 method is best matched to the way
14048     *     the argument is handled internally and will deliver the
14049     *     optimum resolution.  The MJD method and the date &amp; time methods
14050     *     are both good compromises between resolution and convenience.
14051     *
14052     * <li> The result is the angle between the ecliptic and mean equator of
14053     *     date date1+date2.
14054     *</ol>
14055     *<p>Reference:
14056     *
14057     *     <p>Explanatory Supplement to the Astronomical Almanac,
14058     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
14059     *     Expression 3.222-1 (p114).
14060     *
14061     *@version 2009 March 16
14062     *
14063     *  @since Release 20101201
14064     *
14065     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14066     */
14067     public static double jauObl80(double date1, double date2)
14068     {
14069        double t, eps0;
14070 
14071 
14072     /* Interval between fundamental epoch J2000.0 and given date (JC). */
14073        t = ((date1 - DJ00) + date2) / DJC;
14074 
14075     /* Mean obliquity of date. */
14076        eps0 = DAS2R * (84381.448  +
14077                       (-46.8150   +
14078                       (-0.00059   +
14079                       ( 0.001813) * t) * t) * t);
14080 
14081        return eps0;
14082 
14083         }
14084     
14085     
14086     /**
14087      * equinox based precession angles.
14088      *  .
14089      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14090      * @version $Revision$ $date$
14091      */
14092     public static class PrecessionAngles {
14093         /** epsilon_0   obliquity at J2000.0. */
14094         public double eps0; 
14095         /** psi_A       luni-solar precession. */
14096         public double psia;
14097         /** omega_A     inclination of equator wrt J2000.0 ecliptic. */
14098         public  double oma;
14099         /** P_A         ecliptic pole x, J2000.0 ecliptic triad. */
14100         public  double bpa;
14101         /** Q_A         ecliptic pole -y, J2000.0 ecliptic triad. */
14102         public double bqa;
14103         /** pi_A        angle between moving and J2000.0 ecliptics. */
14104         public  double pia;
14105         /** Pi_A        longitude of ascending node of the ecliptic. */
14106         public  double bpia;
14107         /** epsilon_A   obliquity of the ecliptic. */
14108         public double epsa;
14109         /** chi_A       planetary precession. */
14110         public  double chia;
14111         /** z_A         equatorial precession: -3rd 323 Euler angle. */
14112         public  double za;
14113         /** zeta_A      equatorial precession: -1st 323 Euler angle. */
14114         public  double zetaa;
14115         /** theta_A     equatorial precession: 2nd 323 Euler angle. */
14116         public double thetaa;
14117         /** p_A         general precession. */
14118         public  double pa;
14119         /** gamma_J2000 J2000.0 RA difference of ecliptic poles. */
14120         public  double gam;
14121         /** phi_J2000   J2000.0 codeclination of ecliptic pole. */
14122         public  double phi;
14123         /** psi_J2000   longitude difference of equator poles, J2000.0. */
14124         public  double psi;
14125 
14126         public PrecessionAngles ( double eps0, double psia, double oma, double bpa,
14127                  double bqa, double pia, double bpia,
14128                  double epsa, double chia, double za, double zetaa,
14129                  double thetaa, double pa,
14130                  double gam, double phi, double psi){
14131             
14132             this.eps0 = eps0;
14133             this.psia = psia;
14134             this.oma = oma;
14135             this.bpa = bpa;
14136             this.bqa = bqa;
14137             this.pia = pia;
14138             this.bpia = bpia;
14139             this.epsa = epsa;
14140             this.chia = chia;
14141             this.za = za;
14142             this.zetaa = zetaa;
14143             this.thetaa = thetaa;
14144             this.pa = pa;
14145             this.gam = gam;
14146             this.phi = phi;
14147             this.psi = psi;
14148         }
14149     }
14150     /**
14151     *  Precession angles, IAU 2006, equinox based.
14152     *
14153     *<p>This function is derived from the International Astronomical Union's
14154     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14155     *
14156     *<p>Status:  canonical models.
14157     *
14158     *<!-- Given: -->
14159     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14160     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14161     *
14162     *  Returned (see Note 2):
14163     *     eps0          double   epsilon_0
14164     *     psia          double   psi_A
14165     *     oma           double   omega_A
14166     *     bpa           double   P_A
14167     *     bqa           double   Q_A
14168     *     pia           double   pi_A
14169     *     bpia          double   Pi_A
14170     *     epsa          double   obliquity epsilon_A
14171     *     chia          double   chi_A
14172     *     za            double   z_A
14173     *     zetaa         double   zeta_A
14174     *     thetaa        double   theta_A
14175     *     pa            double   p_A
14176     *     gam           double   F-W angle gamma_J2000
14177     *     phi           double   F-W angle phi_J2000
14178     *     psi           double   F-W angle psi_J2000
14179     *
14180     * <p>Notes:
14181     * <ol>
14182     *
14183     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14184     *     convenient way between the two arguments.  For example,
14185     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14186     *     among others:
14187     *<pre>
14188     *            date1          date2
14189     *
14190     *         2450123.7           0.0       (JD method)
14191     *         2451545.0       -1421.3       (J2000 method)
14192     *         2400000.5       50123.2       (MJD method)
14193     *         2450123.5           0.2       (date &amp; time method)
14194     *</pre>
14195     *     The JD method is the most natural and convenient to use in
14196     *     cases where the loss of several decimal digits of resolution
14197     *     is acceptable.  The J2000 method is best matched to the way
14198     *     the argument is handled internally and will deliver the
14199     *     optimum resolution.  The MJD method and the date &amp; time methods
14200     *     are both good compromises between resolution and convenience.
14201     *
14202     * <li> This function returns the set of equinox based angles for the
14203     *     Capitaine et al. "P03" precession theory, adopted by the IAU in
14204     *     2006.  The angles are set out in Table 1 of Hilton et al. (2006):
14205     *
14206     *     eps0   epsilon_0   obliquity at J2000.0
14207     *     psia   psi_A       luni-solar precession
14208     *     oma    omega_A     inclination of equator wrt J2000.0 ecliptic
14209     *     bpa    P_A         ecliptic pole x, J2000.0 ecliptic triad
14210     *     bqa    Q_A         ecliptic pole -y, J2000.0 ecliptic triad
14211     *     pia    pi_A        angle between moving and J2000.0 ecliptics
14212     *     bpia   Pi_A        longitude of ascending node of the ecliptic
14213     *     epsa   epsilon_A   obliquity of the ecliptic
14214     *     chia   chi_A       planetary precession
14215     *     za     z_A         equatorial precession: -3rd 323 Euler angle
14216     *     zetaa  zeta_A      equatorial precession: -1st 323 Euler angle
14217     *     thetaa theta_A     equatorial precession: 2nd 323 Euler angle
14218     *     pa     p_A         general precession
14219     *     gam    gamma_J2000 J2000.0 RA difference of ecliptic poles
14220     *     phi    phi_J2000   J2000.0 codeclination of ecliptic pole
14221     *     psi    psi_J2000   longitude difference of equator poles, J2000.0
14222     *
14223     *     The returned values are all radians.
14224     *
14225     * <li> Hilton et al. (2006) Table 1 also contains angles that depend on
14226     *     models distinct from the P03 precession theory itself, namely the
14227     *     IAU 2000A frame bias and nutation.  The quoted polynomials are
14228     *     used in other JSOFA functions:
14229     *
14230     *     . jauXy06  contains the polynomial parts of the X and Y series.
14231     *
14232     *     . jauS06  contains the polynomial part of the s+XY/2 series.
14233     *
14234     *     . jauPfw06  implements the series for the Fukushima-Williams
14235     *       angles that are with respect to the GCRS pole (i.e. the variants
14236     *       that include frame bias).
14237     *
14238     * <li> The IAU resolution stipulated that the choice of parameterization
14239     *     was left to the user, and so an IAU compliant precession
14240     *     implementation can be constructed using various combinations of
14241     *     the angles returned by the present function.
14242     *
14243     * <li> The parameterization used by JSOFA is the Fukushima-Williams angles
14244     *     referred directly to the GCRS pole.  These are the final four
14245     *     arguments returned by the present function, but are more
14246     *     efficiently calculated by calling the function jauPfw06.   JSOFA
14247     *     also supports the direct computation of the CIP GCRS X,Y by
14248     *     series, available by calling jauXy06.
14249     *
14250     * <li> The agreement between the different parameterizations is at the
14251     *     1 microarcsecond level in the present era.
14252     *
14253     * <li> When constructing a precession formulation that refers to the GCRS
14254     *     pole rather than the dynamical pole, it may (depending on the
14255     *     choice of angles) be necessary to introduce the frame bias
14256     *     explicitly.
14257     *
14258     * <li> It is permissible to re-use the same variable in the returned
14259     *     arguments.  The quantities are stored in the stated order.
14260     *</ol>
14261     *<p>Reference:
14262     *
14263     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14264     *
14265     *<p>Called:<ul>
14266     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14267     * </ul>
14268     *@version 2009 December 17
14269     *
14270     *  @since Release 20101201
14271     *
14272     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14273     */
14274     public static PrecessionAngles jauP06e(double date1, double date2)
14275     {
14276        double t;
14277        double eps0,  psia,  oma,  bpa,
14278         bqa,  pia,  bpia,
14279         epsa,  chia,  za,  zetaa,
14280         thetaa,  pa,
14281         gam,  phi,  psi;
14282 
14283     /* Interval between fundamental date J2000.0 and given date (JC). */
14284        t = ((date1 - DJ00) + date2) / DJC;
14285 
14286     /* Obliquity at J2000.0. */
14287 
14288        eps0 = 84381.406 * DAS2R;
14289 
14290     /* Luni-solar precession. */
14291 
14292        psia = ( 5038.481507     +
14293                (   -1.0790069    +
14294                (   -0.00114045   +
14295                (    0.000132851  +
14296                (   -0.0000000951 )
14297                * t) * t) * t) * t) * t * DAS2R;
14298 
14299     /* Inclination of mean equator with respect to the J2000.0 ecliptic. */
14300 
14301        oma = eps0 + ( -0.025754     +
14302                       (  0.0512623    +
14303                       ( -0.00772503   +
14304                       ( -0.000000467  +
14305                       (  0.0000003337 )
14306                       * t) * t) * t) * t) * t * DAS2R;
14307 
14308     /* Ecliptic pole x, J2000.0 ecliptic triad. */
14309 
14310        bpa = (  4.199094     +
14311               (  0.1939873    +
14312               ( -0.00022466   +
14313               ( -0.000000912  +
14314               (  0.0000000120 )
14315               * t) * t) * t) * t) * t * DAS2R;
14316 
14317     /* Ecliptic pole -y, J2000.0 ecliptic triad. */
14318 
14319        bqa = ( -46.811015     +
14320               (   0.0510283    +
14321               (   0.00052413   +
14322               (  -0.000000646  +
14323               (  -0.0000000172 )
14324               * t) * t) * t) * t) * t * DAS2R;
14325 
14326     /* Angle between moving and J2000.0 ecliptics. */
14327 
14328        pia = ( 46.998973     +
14329               ( -0.0334926    +
14330               ( -0.00012559   +
14331               (  0.000000113  +
14332               ( -0.0000000022 )
14333               * t) * t) * t) * t) * t * DAS2R;
14334 
14335     /* Longitude of ascending node of the moving ecliptic. */
14336 
14337        bpia = ( 629546.7936      +
14338                (   -867.95758     +
14339                (      0.157992    +
14340                (     -0.0005371   +
14341                (     -0.00004797  +
14342                (      0.000000072 )
14343                * t) * t) * t) * t) * t) * DAS2R;
14344 
14345     /* Mean obliquity of the ecliptic. */
14346 
14347        epsa = jauObl06(date1, date2);
14348 
14349     /* Planetary precession. */
14350 
14351        chia = ( 10.556403     +
14352                ( -2.3814292    +
14353                ( -0.00121197   +
14354                (  0.000170663  +
14355                ( -0.0000000560 )
14356                * t) * t) * t) * t) * t * DAS2R;
14357 
14358     /* Equatorial precession: minus the third of the 323 Euler angles. */
14359 
14360        za = (   -2.650545     +
14361              ( 2306.077181     +
14362              (    1.0927348    +
14363              (    0.01826837   +
14364              (   -0.000028596  +
14365              (   -0.0000002904 )
14366              * t) * t) * t) * t) * t) * DAS2R;
14367 
14368     /* Equatorial precession: minus the first of the 323 Euler angles. */
14369 
14370        zetaa = (    2.650545     +
14371                 ( 2306.083227     +
14372                 (    0.2988499    +
14373                 (    0.01801828   +
14374                 (   -0.000005971  +
14375                 (   -0.0000003173 )
14376                 * t) * t) * t) * t) * t) * DAS2R;
14377 
14378     /* Equatorial precession: second of the 323 Euler angles. */
14379 
14380        thetaa = ( 2004.191903     +
14381                  (   -0.4294934    +
14382                  (   -0.04182264   +
14383                  (   -0.000007089  +
14384                  (   -0.0000001274 )
14385                  * t) * t) * t) * t) * t * DAS2R;
14386 
14387     /* General precession. */
14388 
14389        pa = ( 5028.796195     +
14390              (    1.1054348    +
14391              (    0.00007964   +
14392              (   -0.000023857  +
14393              (    0.0000000383 )
14394              * t) * t) * t) * t) * t * DAS2R;
14395 
14396     /* Fukushima-Williams angles for precession. */
14397 
14398        gam = ( 10.556403     +
14399               (  0.4932044    +
14400               ( -0.00031238   +
14401               ( -0.000002788  +
14402               (  0.0000000260 )
14403               * t) * t) * t) * t) * t * DAS2R;
14404 
14405        phi = eps0 + ( -46.811015     +
14406                       (   0.0511269    +
14407                       (   0.00053289   +
14408                       (  -0.000000440  +
14409                       (  -0.0000000176 )
14410                       * t) * t) * t) * t) * t * DAS2R;
14411 
14412        psi = ( 5038.481507     +
14413               (    1.5584176    +
14414               (   -0.00018522   +
14415               (   -0.000026452  +
14416               (   -0.0000000148 )
14417               * t) * t) * t) * t) * t * DAS2R;
14418 
14419        return new PrecessionAngles(eps0, psia, oma, bpa, bqa, pia, bpia, epsa, chia, za, zetaa, thetaa, pa, gam, phi, psi);
14420 
14421         }
14422     
14423 
14424     /**
14425     *  Extend a p-vector to a pv-vector by appending a zero velocity.
14426     *
14427     *<p>This function is derived from the International Astronomical Union's
14428     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14429     *
14430     *<p>Status:  vector/matrix support function.
14431     *
14432     *<!-- Given: -->
14433     *     @param p         double[3]        p-vector
14434     *
14435     *<!-- Returned: -->
14436     *     @return pv        double[2][3]      <u>returned</u> pv-vector
14437     *
14438     *<p>Called:<ul>
14439     *     <li>{@link #jauCp} copy p-vector
14440     *     <li>{@link #jauZp} zero p-vector
14441     * </ul>
14442     *@version 2008 May 11
14443     *
14444     *  @since Release 20101201
14445     *
14446     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14447     */
14448     public static double[][] jauP2pv(double p[] )
14449     {
14450         double pv[][] = new double[3][3];
14451         jauCp(p, pv[0]);
14452         jauZp(pv[1]);
14453 
14454         return pv;
14455 
14456         }
14457     
14458     /**
14459      * A position expressed in spherical polar coordinates.
14460      *  .
14461      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 21 Nov 2011
14462      * @version $Revision$ $date$
14463      */
14464     public static class SphericalPosition {
14465         /** longitude angle (radians) */
14466         public double theta;
14467         /** latitude angle (radians) */
14468         public double phi;
14469         /** radial distance */
14470         public double r;
14471         public SphericalPosition(double theta, double phi, double r) {
14472            this.theta = theta;
14473            this.phi = phi;
14474            this.r = r;
14475         }
14476     }
14477     
14478     /**
14479     *  P-vector to spherical polar coordinates.
14480     *
14481     *<p>This function is derived from the International Astronomical Union's
14482     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14483     *
14484     *<p>Status:  vector/matrix support function.
14485     *
14486     *<!-- Given: -->
14487     *     @param p         double[3]     p-vector
14488     *
14489     *<!-- Returned: -->
14490     *     @return theta     double         <u>returned</u> longitude angle (radians)
14491     *             phi       double         <u>returned</u> latitude angle (radians)
14492     *             r         double         <u>returned</u> radial distance
14493     *
14494     * <p>Notes:
14495     * <ol>
14496     *
14497     * <li> If P is null, zero theta, phi and r are returned.
14498     *
14499     * <li> At either pole, zero theta is returned.
14500     *</ol>
14501     *<p>Called:<ul>
14502     *     <li>{@link #jauC2s} p-vector to spherical
14503     *     <li>{@link #jauPm} modulus of p-vector
14504     * </ul>
14505     *@version 2008 May 22
14506     *
14507     *  @since Release 20101201
14508     *
14509     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14510     */
14511     public static SphericalPosition jauP2s(double p[])
14512     {
14513        SphericalCoordinate sc = jauC2s(p);
14514        double r = jauPm(p);
14515 
14516        return new SphericalPosition(sc.alpha, sc.delta, r);
14517 
14518         }
14519     
14520 
14521     /**
14522     *  Position-angle from two p-vectors.
14523     *
14524     *<p>This function is derived from the International Astronomical Union's
14525     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14526     *
14527     *<p>Status:  vector/matrix support function.
14528     *
14529     *<!-- Given: -->
14530     *     @param a       double[3]   direction of reference point
14531     *     @param b       double[3]   direction of point whose PA is required
14532     *
14533     * <!-- Returned (function value): -->
14534     *  @return double     position angle of b with respect to a (radians)
14535     *
14536     * <p>Notes:
14537     * <ol>
14538     *
14539     * <li> The result is the position angle, in radians, of direction b with
14540     *     respect to direction a.  It is in the range -pi to +pi.  The
14541     *     sense is such that if b is a small distance "north" of a the
14542     *     position angle is approximately zero, and if b is a small
14543     *     distance "east" of a the position angle is approximately +pi/2.
14544     *
14545     * <li> The vectors a and b need not be of unit length.
14546     *
14547     * <li> Zero is returned if the two directions are the same or if either
14548     *     vector is null.
14549     *
14550     * <li> If vector a is at a pole, the result is ill-defined.
14551     *</ol>
14552     *<p>Called:<ul>
14553     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
14554     *     <li>{@link #jauPm} modulus of p-vector
14555     *     <li>{@link #jauPxp} vector product of two p-vectors
14556     *     <li>{@link #jauPmp} p-vector minus p-vector
14557     *     <li>{@link #jauPdp} scalar product of two p-vectors
14558     * </ul>
14559     *@version 2008 May 25
14560     *
14561     *  @since Release 20101201
14562     *
14563     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14564     */
14565     public static double jauPap(double a[] , double b[] )
14566     {
14567        double am, au[] = new double[3], bm, st, ct, xa, ya, za, eta[] = new double[3], xi[] = new double[3], a2b[] = new double[3], pa;
14568 
14569 
14570     /* Modulus and direction of the a vector. */
14571        NormalizedVector nv = jauPn(a );
14572        am = nv.r; au = nv.u;
14573     /* Modulus of the b vector. */
14574        bm = jauPm(b);
14575 
14576     /* Deal with the case of a null vector. */
14577        if ((am == 0.0) || (bm == 0.0)) {
14578           st = 0.0;
14579           ct = 1.0;
14580        } else {
14581 
14582        /* The "north" axis tangential from a (arbitrary length). */
14583           xa = a[0];
14584           ya = a[1];
14585           za = a[2];
14586           eta[0] = -xa * za;
14587           eta[1] = -ya * za;
14588           eta[2] =  xa*xa + ya*ya;
14589 
14590        /* The "east" axis tangential from a (same length). */
14591           xi = jauPxp(eta,au);
14592 
14593        /* The vector from a to b. */
14594           a2b = jauPmp(b, a);
14595 
14596        /* Resolve into components along the north and east axes. */
14597           st = jauPdp(a2b, xi);
14598           ct = jauPdp(a2b, eta);
14599 
14600        /* Deal with degenerate cases. */
14601           if ((st == 0.0) && (ct == 0.0)) ct = 1.0;
14602        }
14603 
14604     /* Position angle. */
14605        pa = atan2(st, ct);
14606 
14607        return pa;
14608 
14609         }
14610     
14611 
14612     /**
14613     *  Position-angle from spherical coordinates.
14614     *
14615     *<p>This function is derived from the International Astronomical Union's
14616     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14617     *
14618     *<p>Status:  vector/matrix support function.
14619     *
14620     *<!-- Given: -->
14621     *     @param al      double      longitude of point A (e.g. RA) in radians
14622     *     @param ap      double      latitude of point A (e.g. Dec) in radians
14623     *     @param bl      double      longitude of point B
14624     *     @param bp      double      latitude of point B
14625     *
14626     * <!-- Returned (function value): -->
14627     *  @return double     position angle of B with respect to A
14628     *
14629     * <p>Notes:
14630     * <ol>
14631     *
14632     * <li> The result is the bearing (position angle), in radians, of point
14633     *     B with respect to point A.  It is in the range -pi to +pi.  The
14634     *     sense is such that if B is a small distance "east" of point A,
14635     *     the bearing is approximately +pi/2.
14636     *
14637     * <li> Zero is returned if the two points are coincident.
14638     *</ol>
14639     *@version 2008 May 22
14640     *
14641     *  @since Release 20101201
14642     *
14643     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14644     */
14645     public static double jauPas(double al, double ap, double bl, double bp)
14646     {
14647        double dl, x, y, pa;
14648 
14649 
14650        dl = bl - al;
14651        y = sin(dl) * cos(bp);
14652        x = sin(bp) * cos(ap) - cos(bp) * sin(ap) * cos(dl);
14653        pa = ((x != 0.0) || (y != 0.0)) ? atan2(y, x) : 0.0;
14654 
14655        return pa;
14656 
14657         }
14658     
14659 
14660     /**
14661     *  This function forms three Euler angles which implement general
14662     *  precession from epoch J2000.0, using the IAU 2006 model.  Frame
14663     *  bias (the offset between ICRS and mean J2000.0) is included.
14664     *
14665     *<p>This function is derived from the International Astronomical Union's
14666     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14667     *
14668     *<p>Status:  support function.
14669     *
14670     *<!-- Given: -->
14671     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14672     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14673     *
14674     *<!-- Returned: -->
14675     *     @return bzeta          1st rotation: radians cw around z,
14676     *                            3rd rotation: radians cw around z,
14677     *                            2nd rotation: radians ccw around y.
14678     *
14679     * <p>Notes:
14680     * <ol>
14681     *
14682     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14683     *     convenient way between the two arguments.  For example,
14684     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14685     *     among others:
14686     *<pre>
14687     *            date1          date2
14688     *
14689     *         2450123.7           0.0       (JD method)
14690     *         2451545.0       -1421.3       (J2000 method)
14691     *         2400000.5       50123.2       (MJD method)
14692     *         2450123.5           0.2       (date &amp; time method)
14693     *</pre>
14694     *     The JD method is the most natural and convenient to use in
14695     *     cases where the loss of several decimal digits of resolution
14696     *     is acceptable.  The J2000 method is best matched to the way
14697     *     the argument is handled internally and will deliver the
14698     *     optimum resolution.  The MJD method and the date &amp; time methods
14699     *     are both good compromises between resolution and convenience.
14700     *
14701     * <li> The traditional accumulated precession angles zeta_A, z_A,
14702     *     theta_A cannot be obtained in the usual way, namely through
14703     *     polynomial expressions, because of the frame bias.  The latter
14704     *     means that two of the angles undergo rapid changes near this
14705     *     date.  They are instead the results of decomposing the
14706     *     precession-bias matrix obtained by using the Fukushima-Williams
14707     *     method, which does not suffer from the problem.  The
14708     *     decomposition returns values which can be used in the
14709     *     conventional formulation and which include frame bias.
14710     *
14711     * <li> The three angles are returned in the conventional order, which
14712     *     is not the same as the order of the corresponding Euler
14713     *     rotations.  The precession-bias matrix is
14714     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
14715     *
14716     * <li> Should zeta_A, z_A, theta_A angles be required that do not
14717     *     contain frame bias, they are available by calling the JSOFA
14718     *     function jauP06e.
14719     *</ol>
14720     *<p>Called:<ul>
14721     *     <li>{@link #jauPmat06} PB matrix, IAU 2006
14722     *     <li>{@link #jauRz} rotate around Z-axis
14723     * </ul>
14724     *@version 2008 May 26
14725     *
14726     *  @since Release 20101201
14727     *
14728     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14729     */
14730     public static EulerAngles jauPb06(double date1, double date2)
14731     {
14732        double r[][] = new double[3][3], r31, r32;
14733 
14734 
14735     /* Precession matrix via Fukushima-Williams angles. */
14736        r = jauPmat06(date1, date2);
14737 
14738     /* Solve for z. */
14739        double bz = atan2(r[1][2], r[0][2]);
14740 
14741     /* Remove it from the matrix. */
14742        jauRz(bz, r);
14743 
14744     /* Solve for the remaining two angles. */
14745        double bzeta = atan2 (r[1][0], r[1][1]);
14746        r31 = r[2][0];
14747        r32 = r[2][1];
14748        double btheta = atan2(-dsign(sqrt(r31 * r31 + r32 * r32), r[0][2]),
14749                        r[2][2]);
14750 
14751        return new EulerAngles(bzeta, bz, btheta);
14752 
14753         }
14754     
14755 
14756     /**
14757     *  p-vector inner (=scalar=dot) product.
14758     *
14759     *<p>This function is derived from the International Astronomical Union's
14760     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14761     *
14762     *<p>Status:  vector/matrix support function.
14763     *
14764     *<!-- Given: -->
14765     *     @param a       double[3]      first p-vector
14766     *     @param b       double[3]      second p-vector
14767     *
14768     * <!-- Returned (function value): -->
14769     *  @return double        a . b
14770     *
14771     *@version 2008 May 22
14772     *
14773     *  @since Release 20101201
14774     *
14775     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14776     */
14777     public static double jauPdp(double a[] , double b[] )
14778     {
14779        double w;
14780 
14781 
14782        w  = a[0] * b[0]
14783           + a[1] * b[1]
14784           + a[2] * b[2];
14785 
14786        return w;
14787 
14788         }
14789     
14790 
14791     /**
14792      * Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14793      * 
14794      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
14795      * 
14796      * @since AIDA Stage 1
14797      */
14798     public static class FWPrecessionAngles{
14799         /** F-W angle gamma_bar (radians) */
14800         public double gamb;
14801         /** F-W angle phi_bar (radians) */
14802         public double phib;
14803         /** F-W angle psi_bar (radians) */
14804         public double psib;
14805         /** F-W angle epsilon_A (radians) */
14806         public double epsa;
14807         public FWPrecessionAngles(double gamb, double phib, double psib, double epsa) {
14808             this.gamb = gamb;
14809             this.phib = phib;
14810             this.psib = psib;
14811             this.epsa = epsa;
14812         }
14813     }
14814     /**
14815     *  Precession angles, IAU 2006 (Fukushima-Williams 4-angle formulation).
14816     *
14817     *<p>This function is derived from the International Astronomical Union's
14818     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14819     *
14820     *<p>Status:  canonical model.
14821     *
14822     *<!-- Given: -->
14823     *     @param date1 double TT as a 2-part Julian Date (Note 1)
14824     *     @param date2 double TT as a 2-part Julian Date (Note 1)
14825     *
14826     *<!-- Returned: -->
14827     *     @return gamb          double     <u>returned</u> F-W angle gamma_bar (radians)
14828     *             phib          double     <u>returned</u> F-W angle phi_bar (radians)
14829     *             psib          double     <u>returned</u> F-W angle psi_bar (radians)
14830     *             epsa          double     <u>returned</u> F-W angle epsilon_A (radians)
14831     *
14832     * <p>Notes:
14833     * <ol>
14834     *
14835     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
14836     *     convenient way between the two arguments.  For example,
14837     *     JD(TT)=2450123.7 could be expressed in any of these ways,
14838     *     among others:
14839     *<pre>
14840     *            date1          date2
14841     *
14842     *         2450123.7           0.0       (JD method)
14843     *         2451545.0       -1421.3       (J2000 method)
14844     *         2400000.5       50123.2       (MJD method)
14845     *         2450123.5           0.2       (date &amp; time method)
14846     *</pre>
14847     *     The JD method is the most natural and convenient to use in
14848     *     cases where the loss of several decimal digits of resolution
14849     *     is acceptable.  The J2000 method is best matched to the way
14850     *     the argument is handled internally and will deliver the
14851     *     optimum resolution.  The MJD method and the date &amp; time methods
14852     *     are both good compromises between resolution and convenience.
14853     *
14854     * <li> Naming the following points:
14855     *
14856     *           e = J2000.0 ecliptic pole,
14857     *           p = GCRS pole,
14858     *           E = mean ecliptic pole of date,
14859     *     and   P = mean pole of date,
14860     *
14861     *     the four Fukushima-Williams angles are as follows:
14862     *
14863     *        gamb = gamma_bar = epE
14864     *        phib = phi_bar = pE
14865     *        psib = psi_bar = pEP
14866     *        epsa = epsilon_A = EP
14867     *
14868     * <li> The matrix representing the combined effects of frame bias and
14869     *     precession is:
14870     *
14871     *        PxB = R_1(-epsa).R_3(-psib).R_1(phib).R_3(gamb)
14872     *
14873     * <li> The matrix representing the combined effects of frame bias,
14874     *     precession and nutation is simply:
14875     *
14876     *        NxPxB = R_1(-epsa-dE).R_3(-psib-dP).R_1(phib).R_3(gamb)
14877     *
14878     *     where dP and dE are the nutation components with respect to the
14879     *     ecliptic of date.
14880     *</ol>
14881     *<p>Reference:
14882     *
14883     *     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
14884     *
14885     *<p>Called:<ul>
14886     *     <li>{@link #jauObl06} mean obliquity, IAU 2006
14887     * </ul>
14888     *@version 2009 December 17
14889     *
14890     *  @since Release 20101201
14891     *
14892     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
14893     */
14894     public static FWPrecessionAngles jauPfw06(double date1, double date2 )
14895     {
14896        double t;
14897 
14898 
14899     /* Interval between fundamental date J2000.0 and given date (JC). */
14900        t = ((date1 - DJ00) + date2) / DJC;
14901 
14902     /* P03 bias+precession angles. */
14903        double gamb = (    -0.052928     +
14904                (    10.556378     +
14905                (     0.4932044    +
14906                (    -0.00031238   +
14907                (    -0.000002788  +
14908                (     0.0000000260 )
14909                * t) * t) * t) * t) * t) * DAS2R;
14910        double phib = ( 84381.412819     +
14911                (   -46.811016     +
14912                (     0.0511268    +
14913                (     0.00053289   +
14914                (    -0.000000440  +
14915                (    -0.0000000176 )
14916                * t) * t) * t) * t) * t) * DAS2R;
14917        double psib = (    -0.041775     +
14918                (  5038.481484     +
14919                (     1.5584175    +
14920                (    -0.00018522   +
14921                (    -0.000026452  +
14922                (    -0.0000000148 )
14923                * t) * t) * t) * t) * t) * DAS2R;
14924        double epsa =  jauObl06(date1, date2);
14925 
14926        return new FWPrecessionAngles(gamb, phib, psib, epsa);
14927 
14928         }
14929     
14930 
14931     /**
14932     *<p>This function is derived from the International Astronomical Union's
14933     *  SOFA (Standards Of Fundamental Astronomy) software collection.
14934     *
14935     *<p>Status:  support function.
14936     *
14937     *  Approximate heliocentric position and velocity of a nominated major
14938     *  planet:  Mercury, Venus, EMB, Mars, Jupiter, Saturn, Uranus or
14939     *  Neptune (but not the Earth itself).
14940     *
14941     *<!-- Given: -->
14942     *     @param date1   double        TDB date part A (Note 1)
14943     *     @param date2   double        TDB date part B (Note 1)
14944     *     @param np      int           planet (1=Mercury, 2=Venus, 3=EMB, 4=Mars,
14945     *                                  5=Jupiter,  6=Saturn,  7=Uranus, 8=Neptune)
14946     *
14947     *  Returned (argument):
14948     *     @param  pv     double[2][3] (returned) planet p,v (heliocentric, J2000.0, au,au/d)
14949     *
14950     * <!-- Returned (function value): -->
14951     *  @return int          status: -1 = illegal NP (outside 1-8)
14952     *                                  0 = OK
14953     *                                 +1 = warning: year outside 1000-3000
14954     *                                 +2 = warning: failed to converge
14955     *
14956     * <p>Notes:
14957     * <ol>
14958     *
14959     * <li> The date date1+date2 is in the TDB time scale (in practice TT can
14960     *     be used) and is a Julian Date, apportioned in any convenient way
14961     *     between the two arguments.  For example, JD(TDB)=2450123.7 could
14962     *     be expressed in any of these ways, among others:
14963     *<pre>
14964     *            date1          date2
14965     *
14966     *         2450123.7           0.0       (JD method)
14967     *         2451545.0       -1421.3       (J2000 method)
14968     *         2400000.5       50123.2       (MJD method)
14969     *         2450123.5           0.2       (date &amp; time method)
14970     *</pre>
14971     *     The JD method is the most natural and convenient to use in cases
14972     *     where the loss of several decimal digits of resolution is
14973     *     acceptable.  The J2000 method is best matched to the way the
14974     *     argument is handled internally and will deliver the optimum
14975     *     resolution.  The MJD method and the date &amp; time methods are both
14976     *     good compromises between resolution and convenience.  The limited
14977     *     accuracy of the present algorithm is such that any of the methods
14978     *     is satisfactory.
14979     *
14980     * <li> If an np value outside the range 1-8 is supplied, an error status
14981     *     (function value -1) is returned and the pv vector set to zeroes.
14982     *
14983     * <li> For np=3 the result is for the Earth-Moon Barycenter.  To obtain
14984     *     the heliocentric position and velocity of the Earth, use instead
14985     *     the JSOFA function jauEpv00.
14986     *
14987     * <li> On successful return, the array pv contains the following:
14988     *<pre>
14989     *        pv[0][0]   x      }
14990     *        pv[0][1]   y      } heliocentric position, au
14991     *        pv[0][2]   z      }
14992     *
14993     *        pv[1][0]   xdot   }
14994     *        pv[1][1]   ydot   } heliocentric velocity, au/d
14995     *        pv[1][2]   zdot   }
14996     *</pre>
14997     *     The reference frame is equatorial and is with respect to the
14998     *     mean equator and equinox of epoch J2000.0.
14999     *
15000     * <li> The algorithm is due to J.L. Simon, P. Bretagnon, J. Chapront,
15001     *     M. Chapront-Touze, G. Francou and J. Laskar (Bureau des
15002     *     Longitudes, Paris, France).  From comparisons with JPL
15003     *     ephemeris DE102, they quote the following maximum errors
15004     *     over the interval 1800-2050:
15005     *<pre>
15006     *                     L (arcsec)    B (arcsec)      R (km)
15007     *
15008     *        Mercury          4             1             300
15009     *        Venus            5             1             800
15010     *        EMB              6             1            1000
15011     *        Mars            17             1            7700
15012     *        Jupiter         71             5           76000
15013     *        Saturn          81            13          267000
15014     *        Uranus          86             7          712000
15015     *        Neptune         11             1          253000
15016     *</pre>
15017     *     Over the interval 1000-3000, they report that the accuracy is no
15018     *     worse than 1.5 times that over 1800-2050.  Outside 1000-3000 the
15019     *     accuracy declines.
15020     *
15021     *     Comparisons of the present function with the JPL DE200 ephemeris
15022     *     give the following RMS errors over the interval 1960-2025:
15023     *<pre>
15024     *                      position (km)     velocity (m/s)
15025     *
15026     *        Mercury            334               0.437
15027     *        Venus             1060               0.855
15028     *        EMB               2010               0.815
15029     *        Mars              7690               1.98
15030     *        Jupiter          71700               7.70
15031     *        Saturn          199000              19.4
15032     *        Uranus          564000              16.4
15033     *        Neptune         158000              14.4
15034     *</pre>
15035     *     Comparisons against DE200 over the interval 1800-2100 gave the
15036     *     following maximum absolute differences.  (The results using
15037     *     DE406 were essentially the same.)
15038     *<pre>
15039     *                   L (arcsec)   B (arcsec)     R (km)   Rdot (m/s)
15040     *
15041     *        Mercury        7            1            500       0.7
15042     *        Venus          7            1           1100       0.9
15043     *        EMB            9            1           1300       1.0
15044     *        Mars          26            1           9000       2.5
15045     *        Jupiter       78            6          82000       8.2
15046     *        Saturn        87           14         263000      24.6
15047     *        Uranus        86            7         661000      27.4
15048     *        Neptune       11            2         248000      21.4
15049     *</pre>
15050     * <li> The present JSOFA re-implementation of the original Simon et al.
15051     *     Fortran code differs from the original in the following respects:
15052     *<ul>
15053     *       <li>  C instead of Fortran.
15054     *
15055     *       <li>  The date is supplied in two parts.
15056     *
15057     *       <li>  The result is returned only in equatorial Cartesian form;
15058     *          the ecliptic longitude, latitude and radius vector are not
15059     *          returned.
15060     *
15061     *       <li>  The result is in the J2000.0 equatorial frame, not ecliptic.
15062     *
15063     *       <li>  More is done in-line: there are fewer calls to subroutines.
15064     *
15065     *       <li>  Different error/warning status values are used.
15066     *
15067     *       <li>  A different Kepler's-equation-solver is used (avoiding
15068     *          use of double precision complex).
15069     *
15070     *       <li>  Polynomials in t are nested to minimize rounding errors.
15071     *
15072     *       <li>  Explicit double constants are used to avoid mixed-mode
15073     *          expressions.
15074     *</ul>
15075     *     None of the above changes affects the result significantly.
15076     *
15077     * <li> The returned status indicates the most serious condition
15078     *     encountered during execution of the function.  Illegal np is
15079     *     considered the most serious, overriding failure to converge,
15080     *     which in turn takes precedence over the remote date warning.
15081     *</ol>
15082     *<p>Called:<ul>
15083     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
15084     * </ul>
15085     *<p>Reference:  Simon, J.L, Bretagnon, P., Chapront, J.,
15086     *              Chapront-Touze, M., Francou, G., and Laskar, J.,
15087     *              Astron. Astrophys. 282, 663 (1994).
15088     *
15089     *@version 2009 December 17
15090     *
15091     *  @since Release 20101201
15092     *
15093     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15094     */
15095     public static int jauPlan94(double date1, double date2, int np, double pv[][])
15096     {
15097     /* Gaussian constant */
15098        final double GK = 0.017202098950;
15099 
15100     /* Sin and cos of J2000.0 mean obliquity (IAU 1976) */
15101        final double SINEPS = 0.3977771559319137;
15102        final double COSEPS = 0.9174820620691818;
15103 
15104     /* Maximum number of iterations allowed to solve Kepler's equation */
15105        final int KMAX = 10;
15106 
15107        int jstat, i, k;
15108        double t, da, dl, de, dp, di, dom, dmu, arga, argl, am,
15109               ae, dae, ae2, at, r, v, si2, xq, xp, tl, xsw,
15110               xcw, xm2, xf, ci2, xms, xmc, xpxq2, x, y, z;
15111 
15112     /* Planetary inverse masses */
15113        final double amas[] = { 6023600.0,       /* Mercury */
15114                                        408523.5,       /* Venus   */
15115                                        328900.5,       /* EMB     */
15116                                       3098710.0,       /* Mars    */
15117                                          1047.355,     /* Jupiter */
15118                                          3498.5,       /* Saturn  */
15119                                         22869.0,       /* Uranus  */
15120                                         19314.0 };     /* Neptune */
15121 
15122     /*
15123     * Tables giving the mean Keplerian elements, limited to t^2 terms:
15124     *
15125     *   a       semi-major axis (au)
15126     *   dlm     mean longitude (degree and arcsecond)
15127     *   e       eccentricity
15128     *   pi      longitude of the perihelion (degree and arcsecond)
15129     *   dinc    inclination (degree and arcsecond)
15130     *   omega   longitude of the ascending node (degree and arcsecond)
15131     */
15132 
15133        final double a[][] = {
15134            {  0.3870983098,           0.0,     0.0 },  /* Mercury */
15135            {  0.7233298200,           0.0,     0.0 },  /* Venus   */
15136            {  1.0000010178,           0.0,     0.0 },  /* EMB     */
15137            {  1.5236793419,         3e-10,     0.0 },  /* Mars    */
15138            {  5.2026032092,     19132e-10, -39e-10 },  /* Jupiter */
15139            {  9.5549091915, -0.0000213896, 444e-10 },  /* Saturn  */
15140            { 19.2184460618,     -3716e-10, 979e-10 },  /* Uranus  */
15141            { 30.1103868694,    -16635e-10, 686e-10 }   /* Neptune */
15142        };
15143 
15144        final double dlm[][] = {
15145            { 252.25090552, 5381016286.88982,  -1.92789 },
15146            { 181.97980085, 2106641364.33548,   0.59381 },
15147            { 100.46645683, 1295977422.83429,  -2.04411 },
15148            { 355.43299958,  689050774.93988,   0.94264 },
15149            {  34.35151874,  109256603.77991, -30.60378 },
15150            {  50.07744430,   43996098.55732,  75.61614 },
15151            { 314.05500511,   15424811.93933,  -1.75083 },
15152            { 304.34866548,    7865503.20744,   0.21103 }
15153        };
15154 
15155        final double e[][] = {
15156            { 0.2056317526,  0.0002040653,    -28349e-10 },
15157            { 0.0067719164, -0.0004776521,     98127e-10 },
15158            { 0.0167086342, -0.0004203654, -0.0000126734 },
15159            { 0.0934006477,  0.0009048438,    -80641e-10 },
15160            { 0.0484979255,  0.0016322542, -0.0000471366 },
15161            { 0.0555481426, -0.0034664062, -0.0000643639 },
15162            { 0.0463812221, -0.0002729293,  0.0000078913 },
15163            { 0.0094557470,  0.0000603263,           0.0 }
15164        };
15165 
15166        final double pi[][] = {
15167            {  77.45611904,  5719.11590,   -4.83016 },
15168            { 131.56370300,   175.48640, -498.48184 },
15169            { 102.93734808, 11612.35290,   53.27577 },
15170            { 336.06023395, 15980.45908,  -62.32800 },
15171            {  14.33120687,  7758.75163,  259.95938 },
15172            {  93.05723748, 20395.49439,  190.25952 },
15173            { 173.00529106,  3215.56238,  -34.09288 },
15174            {  48.12027554,  1050.71912,   27.39717 }
15175        };
15176 
15177        final double dinc[][] = {
15178            { 7.00498625, -214.25629,   0.28977 },
15179            { 3.39466189,  -30.84437, -11.67836 },
15180            {        0.0,  469.97289,  -3.35053 },
15181            { 1.84972648, -293.31722,  -8.11830 },
15182            { 1.30326698,  -71.55890,  11.95297 },
15183            { 2.48887878,   91.85195, -17.66225 },
15184            { 0.77319689,  -60.72723,   1.25759 },
15185            { 1.76995259,    8.12333,   0.08135 }
15186        };
15187 
15188        final double omega[][] = {
15189            {  48.33089304,  -4515.21727,  -31.79892 },
15190            {  76.67992019, -10008.48154,  -51.32614 },
15191            { 174.87317577,  -8679.27034,   15.34191 },
15192            {  49.55809321, -10620.90088, -230.57416 },
15193            { 100.46440702,   6362.03561,  326.52178 },
15194            { 113.66550252,  -9240.19942,  -66.23743 },
15195            {  74.00595701,   2669.15033,  145.93964 },
15196            { 131.78405702,   -221.94322,   -0.78728 }
15197        };
15198 
15199     /* Tables for trigonometric terms to be added to the mean elements of */
15200     /* the semi-major axes */
15201 
15202        final double kp[][] = {
15203         {   69613, 75645, 88306, 59899, 15746, 71087, 142173,  3086,    0 },
15204         {   21863, 32794, 26934, 10931, 26250, 43725,  53867, 28939,    0 },
15205         {   16002, 21863, 32004, 10931, 14529, 16368,  15318, 32794,    0 },
15206         {    6345,  7818, 15636,  7077,  8184, 14163,   1107,  4872,    0 },
15207         {    1760,  1454,  1167,   880,   287,  2640,     19,  2047, 1454 },
15208         {     574,     0,   880,   287,    19,  1760,   1167,   306,  574 },
15209         {     204,     0,   177,  1265,     4,   385,    200,   208,  204 },
15210         {       0,   102,   106,     4,    98,  1367,    487,   204,    0 }
15211        };
15212 
15213        final double ca[][] = {
15214         {       4,    -13,    11,   -9,    -9,   -3,     -1,     4,     0 },
15215         {    -156,     59,   -42,    6,    19,  -20,    -10,   -12,     0 },
15216         {      64,   -152,    62,   -8,    32,  -41,     19,   -11,     0 },
15217         {     124,    621,  -145,  208,    54,  -57,     30,    15,     0 },
15218         {  -23437,  -2634,  6601, 6259, -1507,-1821,   2620, -2115, -1489 },
15219         {   62911,-119919, 79336,17814,-24241,12068,   8306, -4893,  8902 },
15220         {  389061,-262125,-44088, 8387,-22976,-2093,   -615, -9720,  6633 },
15221         { -412235,-157046,-31430,37817, -9740,  -13,  -7449,  9644,     0 }
15222        };
15223 
15224        final double sa[][] = {
15225         {     -29,    -1,     9,     6,    -6,     5,     4,     0,     0 },
15226         {     -48,  -125,   -26,   -37,    18,   -13,   -20,    -2,     0 },
15227         {    -150,   -46,    68,    54,    14,    24,   -28,    22,     0 },
15228         {    -621,   532,  -694,   -20,   192,   -94,    71,   -73,     0 },
15229         {  -14614,-19828, -5869,  1881, -4372, -2255,   782,   930,   913 },
15230         {  139737,     0, 24667, 51123, -5102,  7429, -4095, -1976, -9566 },
15231         { -138081,     0, 37205,-49039,-41901,-33872,-27037,-12474, 18797 },
15232         {       0, 28492,133236, 69654, 52322,-49577,-26430, -3593,     0 }
15233        };
15234 
15235     /* Tables giving the trigonometric terms to be added to the mean */
15236     /* elements of the mean longitudes */
15237 
15238        final double kq[][] = {
15239         {   3086,15746,69613,59899,75645,88306, 12661,  2658,    0,     0 },
15240         {  21863,32794,10931,   73, 4387,26934,  1473,  2157,    0,     0 },
15241         {     10,16002,21863,10931, 1473,32004,  4387,    73,    0,     0 },
15242         {     10, 6345, 7818, 1107,15636, 7077,  8184,   532,   10,     0 },
15243         {     19, 1760, 1454,  287, 1167,  880,   574,  2640,   19,  1454 },
15244         {     19,  574,  287,  306, 1760,   12,    31,    38,   19,   574 },
15245         {      4,  204,  177,    8,   31,  200,  1265,   102,    4,   204 },
15246         {      4,  102,  106,    8,   98, 1367,   487,   204,    4,   102 }
15247        };
15248 
15249        final double cl[][] = {
15250         {      21,   -95, -157,   41,   -5,   42,  23,  30,      0,     0 },
15251         {    -160,  -313, -235,   60,  -74,  -76, -27,  34,      0,     0 },
15252         {    -325,  -322,  -79,  232,  -52,   97,  55, -41,      0,     0 },
15253         {    2268,  -979,  802,  602, -668,  -33, 345, 201,    -55,     0 },
15254         {    7610, -4997,-7689,-5841,-2617, 1115,-748,-607,   6074,   354 },
15255         {  -18549, 30125,20012, -730,  824,   23,1289,-352, -14767, -2062 },
15256         { -135245,-14594, 4197,-4030,-5630,-2898,2540,-306,   2939,  1986 },
15257         {   89948,  2103, 8963, 2695, 3682, 1648, 866,-154,  -1963,  -283 }
15258        };
15259 
15260        final double sl[][] = {
15261         {   -342,   136,  -23,   62,   66,  -52, -33,    17,     0,     0 },
15262         {    524,  -149,  -35,  117,  151,  122, -71,   -62,     0,     0 },
15263         {   -105,  -137,  258,   35, -116,  -88,-112,   -80,     0,     0 },
15264         {    854,  -205, -936, -240,  140, -341, -97,  -232,   536,     0 },
15265         { -56980,  8016, 1012, 1448,-3024,-3710, 318,   503,  3767,   577 },
15266         { 138606,-13478,-4964, 1441,-1319,-1482, 427,  1236, -9167, -1918 },
15267         {  71234,-41116, 5334,-4935,-1848,   66, 434, -1748,  3780,  -701 },
15268         { -47645, 11647, 2166, 3194,  679,    0,-244,  -419, -2531,    48 }
15269        };
15270 
15271     /*--------------------------------------------------------------------*/
15272 
15273     /* Validate the planet number. */
15274        if ((np < 1) || (np > 8)) {
15275           jstat = -1;
15276 
15277        /* Reset the result in case of failure. */
15278           for (k = 0; k < 2; k++) {
15279              for (i = 0; i < 3; i++) {
15280                 pv[k][i] = 0.0;
15281              }
15282           }
15283 
15284        } else {
15285 
15286        /* Decrement the planet number to start at zero. */
15287           np--;
15288 
15289        /* Time: Julian millennia since J2000.0. */
15290           t = ((date1 - DJ00) + date2) / DJM;
15291 
15292        /* OK status unless remote date. */
15293           jstat = abs(t) <= 1.0 ? 0 : 1;
15294 
15295        /* Compute the mean elements. */
15296           da = a[np][0] +
15297               (a[np][1] +
15298                a[np][2] * t) * t;
15299           dl = (3600.0 * dlm[np][0] +
15300                         (dlm[np][1] +
15301                          dlm[np][2] * t) * t) * DAS2R;
15302           de = e[np][0] +
15303              ( e[np][1] +
15304                e[np][2] * t) * t;
15305           dp = jauAnpm((3600.0 * pi[np][0] +
15306                                 (pi[np][1] +
15307                                  pi[np][2] * t) * t) * DAS2R);
15308           di = (3600.0 * dinc[np][0] +
15309                         (dinc[np][1] +
15310                          dinc[np][2] * t) * t) * DAS2R;
15311           dom = jauAnpm((3600.0 * omega[np][0] +
15312                                  (omega[np][1] +
15313                                   omega[np][2] * t) * t) * DAS2R);
15314 
15315        /* Apply the trigonometric terms. */
15316           dmu = 0.35953620 * t;
15317           for (k = 0; k < 8; k++) {
15318              arga = kp[np][k] * dmu;
15319              argl = kq[np][k] * dmu;
15320              da += (ca[np][k] * cos(arga) +
15321                     sa[np][k] * sin(arga)) * 1e-7;
15322              dl += (cl[np][k] * cos(argl) +
15323                     sl[np][k] * sin(argl)) * 1e-7;
15324           }
15325           arga = kp[np][8] * dmu;
15326           da += t * (ca[np][8] * cos(arga) +
15327                      sa[np][8] * sin(arga)) * 1e-7;
15328           for (k = 8; k < 10; k++) {
15329              argl = kq[np][k] * dmu;
15330              dl += t * (cl[np][k] * cos(argl) +
15331                         sl[np][k] * sin(argl)) * 1e-7;
15332           }
15333           dl = fmod(dl, D2PI);
15334 
15335        /* Iterative soln. of Kepler's equation to get eccentric anomaly. */
15336           am = dl - dp;
15337           ae = am + de * sin(am);
15338           k = 0;
15339           dae = 1.0;
15340           while (k < KMAX && abs(dae) > 1e-12) {
15341              dae = (am - ae + de * sin(ae)) / (1.0 - de * cos(ae));
15342              ae += dae;
15343              k++;
15344              if (k == KMAX-1) jstat = 2;
15345           }
15346 
15347        /* True anomaly. */
15348           ae2 = ae / 2.0;
15349           at = 2.0 * atan2(sqrt((1.0 + de) / (1.0 - de)) * sin(ae2),
15350                                                            cos(ae2));
15351 
15352        /* Distance (au) and speed (radians per day). */
15353           r = da * (1.0 - de * cos(ae));
15354           v = GK * sqrt((1.0 + 1.0 / amas[np]) / (da * da * da));
15355 
15356           si2 = sin(di / 2.0);
15357           xq = si2 * cos(dom);
15358           xp = si2 * sin(dom);
15359           tl = at + dp;
15360           xsw = sin(tl);
15361           xcw = cos(tl);
15362           xm2 = 2.0 * (xp * xcw - xq * xsw);
15363           xf = da / sqrt(1  -  de * de);
15364           ci2 = cos(di / 2.0);
15365           xms = (de * sin(dp) + xsw) * xf;
15366           xmc = (de * cos(dp) + xcw) * xf;
15367           xpxq2 = 2 * xp * xq;
15368 
15369        /* Position (J2000.0 ecliptic x,y,z in au). */
15370           x = r * (xcw - xm2 * xp);
15371           y = r * (xsw + xm2 * xq);
15372           z = r * (-xm2 * ci2);
15373 
15374        /* Rotate to equatorial. */
15375           pv[0][0] = x;
15376           pv[0][1] = y * COSEPS - z * SINEPS;
15377           pv[0][2] = y * SINEPS + z * COSEPS;
15378 
15379        /* Velocity (J2000.0 ecliptic xdot,ydot,zdot in au/d). */
15380           x = v * (( -1.0 + 2.0 * xp * xp) * xms + xpxq2 * xmc);
15381           y = v * ((  1.0 - 2.0 * xq * xq) * xmc - xpxq2 * xms);
15382           z = v * (2.0 * ci2 * (xp * xms + xq * xmc));
15383 
15384        /* Rotate to equatorial. */
15385           pv[1][0] = x;
15386           pv[1][1] = y * COSEPS - z * SINEPS;
15387           pv[1][2] = y * SINEPS + z * COSEPS;
15388 
15389        }
15390 
15391     /* Return the status. */
15392        return jstat;
15393 
15394         }
15395     
15396 
15397     /**
15398     *  Modulus of p-vector.
15399     *
15400     *<p>This function is derived from the International Astronomical Union's
15401     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15402     *
15403     *<p>Status:  vector/matrix support function.
15404     *
15405     *<!-- Given: -->
15406     *     @param p       double[3]      p-vector
15407     *
15408     * <!-- Returned (function value): -->
15409     *  @return double        modulus
15410     *
15411     *@version 2008 May 22
15412     *
15413     *  @since Release 20101201
15414     *
15415     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15416     */
15417     public static double jauPm(double p[] )
15418     {
15419        double w;
15420 
15421 
15422        w  = sqrt( p[0] * p[0]
15423                 + p[1] * p[1]
15424                 + p[2] * p[2] );
15425 
15426        return w;
15427 
15428         }
15429     
15430 
15431     /**
15432     *  Precession matrix (including frame bias) from GCRS to a specified
15433     *  date, IAU 2000 model.
15434     *
15435     *<p>This function is derived from the International Astronomical Union's
15436     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15437     *
15438     *<p>Status:  support function.
15439     *
15440     *<!-- Given: -->
15441     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15442     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15443     *
15444     *<!-- Returned: -->
15445     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15446     *
15447     * <p>Notes:
15448     * <ol>
15449     *
15450     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15451     *     convenient way between the two arguments.  For example,
15452     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15453     *     among others:
15454     *<pre>
15455     *            date1          date2
15456     *
15457     *         2450123.7           0.0       (JD method)
15458     *         2451545.0       -1421.3       (J2000 method)
15459     *         2400000.5       50123.2       (MJD method)
15460     *         2450123.5           0.2       (date &amp; time method)
15461     *</pre>
15462     *     The JD method is the most natural and convenient to use in
15463     *     cases where the loss of several decimal digits of resolution
15464     *     is acceptable.  The J2000 method is best matched to the way
15465     *     the argument is handled internally and will deliver the
15466     *     optimum resolution.  The MJD method and the date &amp; time methods
15467     *     are both good compromises between resolution and convenience.
15468     *
15469     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15470     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15471     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15472     *     respect to the mean equatorial triad of the given date.
15473     *</ol>
15474     *<p>Called:<ul>
15475     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15476     * </ul>
15477     *<p>Reference:
15478     *
15479     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
15480     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
15481     *     (2000)
15482     *
15483     *@version 2009 December 21
15484     *
15485     *  @since Release 20101201
15486     *
15487     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15488     */
15489     public static double[][] jauPmat00(double date1, double date2)
15490     {
15491        double rb[][] = new double[3][3], rp[][] = new double[3][3],
15492            rbp[][] = new double[3][3];
15493     /* Obtain the required matrix (discarding others). */
15494        jauBp00(date1, date2, rb, rp, rbp);
15495 
15496        return rbp;
15497 
15498         }
15499     
15500 
15501     /**
15502     *  Precession matrix (including frame bias) from GCRS to a specified
15503     *  date, IAU 2006 model.
15504     *
15505     *<p>This function is derived from the International Astronomical Union's
15506     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15507     *
15508     *<p>Status:  support function.
15509     *
15510     *<!-- Given: -->
15511     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15512     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15513     *
15514     *<!-- Returned: -->
15515     *     @return rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 2)
15516     *
15517     * <p>Notes:
15518     * <ol>
15519     *
15520     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15521     *     convenient way between the two arguments.  For example,
15522     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15523     *     among others:
15524     *<pre>
15525     *            date1          date2
15526     *
15527     *         2450123.7           0.0       (JD method)
15528     *         2451545.0       -1421.3       (J2000 method)
15529     *         2400000.5       50123.2       (MJD method)
15530     *         2450123.5           0.2       (date &amp; time method)
15531     *</pre>
15532     *     The JD method is the most natural and convenient to use in
15533     *     cases where the loss of several decimal digits of resolution
15534     *     is acceptable.  The J2000 method is best matched to the way
15535     *     the argument is handled internally and will deliver the
15536     *     optimum resolution.  The MJD method and the date &amp; time methods
15537     *     are both good compromises between resolution and convenience.
15538     *
15539     * <li> The matrix operates in the sense V(date) = rbp * V(GCRS), where
15540     *     the p-vector V(GCRS) is with respect to the Geocentric Celestial
15541     *     Reference System (IAU, 2000) and the p-vector V(date) is with
15542     *     respect to the mean equatorial triad of the given date.
15543     *</ol>
15544     *<p>Called:<ul>
15545     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
15546     *     <li>{@link #jauFw2m} F-W angles to r-matrix
15547     * </ul>
15548     *<p>References:
15549     *
15550     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
15551     *
15552     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
15553     *
15554     *@version 2009 December 21
15555     *
15556     *  @since Release 20101201
15557     *
15558     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15559     */
15560     public static double[][] jauPmat06(double date1, double date2)
15561     {
15562 
15563     /* Bias-precession Fukushima-Williams angles. */
15564        FWPrecessionAngles fw = jauPfw06(date1, date2);
15565 
15566     /* Form the matrix. */
15567        double[][] rbp = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
15568 
15569        return rbp;
15570 
15571         }
15572     
15573 
15574     /**
15575     *  Precession matrix from J2000.0 to a specified date, IAU 1976 model.
15576     *
15577     *<p>This function is derived from the International Astronomical Union's
15578     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15579     *
15580     *<p>Status:  support function.
15581     *
15582     *<!-- Given: -->
15583     *     @param date1 double        ending date, TT (Note 1)
15584     *     @param date2 double        ending date, TT (Note 1) 
15585     *
15586     *<!-- Returned: -->
15587     *     @return rmatp        double[3][3]   <u>returned</u> precession matrix, J2000.0 -&gt; date1+date2
15588     *
15589     * <p>Notes:
15590     * <ol>
15591     *
15592     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15593     *     convenient way between the two arguments.  For example,
15594     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15595     *     among others:
15596     *<pre>
15597     *            date1          date2
15598     *
15599     *         2450123.7           0.0       (JD method)
15600     *         2451545.0       -1421.3       (J2000 method)
15601     *         2400000.5       50123.2       (MJD method)
15602     *         2450123.5           0.2       (date &amp; time method)
15603     *</pre>
15604     *     The JD method is the most natural and convenient to use in
15605     *     cases where the loss of several decimal digits of resolution
15606     *     is acceptable.  The J2000 method is best matched to the way
15607     *     the argument is handled internally and will deliver the
15608     *     optimum resolution.  The MJD method and the date &amp; time methods
15609     *     are both good compromises between resolution and convenience.
15610     *
15611     * <li> The matrix operates in the sense V(date) = RMATP * V(J2000),
15612     *     where the p-vector V(J2000) is with respect to the mean
15613     *     equatorial triad of epoch J2000.0 and the p-vector V(date)
15614     *     is with respect to the mean equatorial triad of the given
15615     *     date.
15616     *
15617     * <li> Though the matrix method itself is rigorous, the precession
15618     *     angles are expressed through canonical polynomials which are
15619     *     valid only for a limited time span.  In addition, the IAU 1976
15620     *     precession rate is known to be imperfect.  The absolute accuracy
15621     *     of the present formulation is better than 0.1 arcsec from
15622     *     1960AD to 2040AD, better than 1 arcsec from 1640AD to 2360AD,
15623     *     and remains below 3 arcsec for the whole of the period
15624     *     500BC to 3000AD.  The errors exceed 10 arcsec outside the
15625     *     range 1200BC to 3900AD, exceed 100 arcsec outside 4200BC to
15626     *     5600AD and exceed 1000 arcsec outside 6800BC to 8200AD.
15627     *</ol>
15628     *<p>Called:<ul>
15629     *     <li>{@link #jauPrec76} accumulated precession angles, IAU 1976
15630     *     <li>{@link #jauIr} initialize r-matrix to identity
15631     *     <li>{@link #jauRz} rotate around Z-axis
15632     *     <li>{@link #jauRy} rotate around Y-axis
15633     *     <li>{@link #jauCr} copy r-matrix
15634     * </ul>
15635     *<p>References:
15636     *
15637     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
15638     *      equations (6) &amp; (7), p283.
15639     *
15640     *     Kaplan,G.H., 1981. USNO circular no. 163, pA2.
15641     *
15642     *@version 2009 December 18
15643     *
15644     *  @since Release 20101201
15645     *
15646     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15647     */
15648     public static double[][] jauPmat76(double date1, double date2)
15649     {
15650        double wmat[][] = new double[3][3];
15651        double rmatp[][] = new double[3][3];
15652 
15653     /* Precession Euler angles, J2000.0 to specified date. */
15654        EulerAngles euler = jauPrec76(DJ00, 0.0, date1, date2);
15655 
15656     /* Form the rotation matrix. */
15657        jauIr(  wmat);
15658        jauRz( -euler.zeta, wmat);
15659        jauRy(  euler.theta, wmat);
15660        jauRz( -euler.z, wmat);
15661        jauCr(wmat, rmatp);
15662 
15663        return rmatp;
15664 
15665         }
15666     
15667 
15668     /**
15669     *  P-vector subtraction.
15670     *
15671     *<p>This function is derived from the International Astronomical Union's
15672     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15673     *
15674     *<p>Status:  vector/matrix support function.
15675     *
15676     *<!-- Given: -->
15677     *     @param a         double[3]       first p-vector
15678     *     @param b         double[3]       second p-vector
15679     *
15680     *<!-- Returned: -->
15681     *     @return amb       double[3]        <u>returned</u> a - b
15682     *
15683     *  Note:
15684     *     It is permissible to re-use the same array for any of the
15685     *     arguments.
15686     *
15687     *@version 2008 November 18
15688     *
15689     *  @since Release 20101201
15690     *
15691     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15692     */
15693     public static double[]  jauPmp(double a[] , double b[]  )
15694     {
15695        double amb[] = new double[3];
15696        amb[0] = a[0] - b[0];
15697        amb[1] = a[1] - b[1];
15698        amb[2] = a[2] - b[2];
15699 
15700        return amb;
15701 
15702         }
15703     
15704     /**
15705      * A normalized vector with r being the modulus and u[3] being the unit vector.
15706      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
15707      * 
15708      * @since AIDA Stage 1
15709      */
15710     public static class NormalizedVector {
15711         public double r;
15712         public double u[];
15713         public NormalizedVector(double r, double u[] ) {
15714             this.r = r;
15715             this.u = u;
15716         }
15717     }
15718     /**
15719     *  Convert a p-vector into modulus and unit vector.
15720     *
15721     *<p>This function is derived from the International Astronomical Union's
15722     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15723     *
15724     *<p>Status:  vector/matrix support function.
15725     *
15726     *<!-- Given: -->
15727     *     @param p         double[3]       p-vector
15728     *
15729     *<!-- Returned: -->
15730     *     @return r         double           <u>returned</u> modulus
15731     *             u         double[3]        <u>returned</u> unit vector
15732     *
15733     * <p>Notes:
15734     * <ol>
15735     *
15736     * <li> If p is null, the result is null.  Otherwise the result is a unit
15737     *     vector.
15738     *
15739     * <li> It is permissible to re-use the same array for any of the
15740     *     arguments.
15741     *</ol>
15742     *<p>Called:<ul>
15743     *     <li>{@link #jauPm} modulus of p-vector
15744     *     <li>{@link #jauZp} zero p-vector
15745     *     <li>{@link #jauSxp} multiply p-vector by scalar
15746     * </ul>
15747     *@version 2008 November 18
15748     *
15749     *  @since Release 20101201
15750     *
15751     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15752     */
15753     public static NormalizedVector jauPn(double p[])
15754     {
15755        double w;
15756 
15757     /* Obtain the modulus and test for zero. */
15758        w = jauPm(p);
15759        NormalizedVector nv = new NormalizedVector(w, new double[3]);
15760        if (w == 0.0) {
15761 
15762        /* Null vector. */
15763           jauZp(nv.u);
15764 
15765        } else {
15766 
15767        /* Unit vector. */
15768            nv.u = jauSxp(1.0/w, p);
15769        }
15770 
15771 
15772        return nv;
15773 
15774         }
15775     
15776 
15777     /**
15778     *  Precession-nutation, IAU 2000 model:  a multi-purpose function,
15779     *  supporting classical (equinox-based) use directly and CIO-based
15780     *  use indirectly.
15781     *
15782     *<p>This function is derived from the International Astronomical Union's
15783     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15784     *
15785     *<p>Status:  support function.
15786     *
15787     *<!-- Given: -->
15788     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15789     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15790     *     @param dpsi double           nutation (Note 2)
15791     *     @param deps double           nutation (Note 2) 
15792     *
15793     *<!-- Returned: -->
15794     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3),
15795     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4),
15796     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5),
15797     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6),
15798     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7),
15799     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8)
15800     *
15801     * <p>Notes:
15802     * <ol>
15803     *
15804     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
15805     *     convenient way between the two arguments.  For example,
15806     *     JD(TT)=2450123.7 could be expressed in any of these ways,
15807     *     among others:
15808     *<pre>
15809     *            date1          date2
15810     *
15811     *         2450123.7           0.0       (JD method)
15812     *         2451545.0       -1421.3       (J2000 method)
15813     *         2400000.5       50123.2       (MJD method)
15814     *         2450123.5           0.2       (date &amp; time method)
15815     *</pre>
15816     *     The JD method is the most natural and convenient to use in
15817     *     cases where the loss of several decimal digits of resolution
15818     *     is acceptable.  The J2000 method is best matched to the way
15819     *     the argument is handled internally and will deliver the
15820     *     optimum resolution.  The MJD method and the date &amp; time methods
15821     *     are both good compromises between resolution and convenience.
15822     *
15823     * <li> The caller is responsible for providing the nutation components;
15824     *     they are in longitude and obliquity, in radians and are with
15825     *     respect to the equinox and ecliptic of date.  For high-accuracy
15826     *     applications, free core nutation should be included as well as
15827     *     any other relevant corrections to the position of the CIP.
15828     *
15829     * <li> The returned mean obliquity is consistent with the IAU 2000
15830     *     precession-nutation models.
15831     *
15832     * <li> The matrix rb transforms vectors from GCRS to J2000.0 mean
15833     *     equator and equinox by applying frame bias.
15834     *
15835     * <li> The matrix rp transforms vectors from J2000.0 mean equator and
15836     *     equinox to mean equator and equinox of date by applying
15837     *     precession.
15838     *
15839     * <li> The matrix rbp transforms vectors from GCRS to mean equator and
15840     *     equinox of date by applying frame bias then precession.  It is
15841     *     the product rp x rb.
15842     *
15843     * <li> The matrix rn transforms vectors from mean equator and equinox of
15844     *     date to true equator and equinox of date by applying the nutation
15845     *     (luni-solar + planetary).
15846     *
15847     * <li> The matrix rbpn transforms vectors from GCRS to true equator and
15848     *     equinox of date.  It is the product rn x rbp, applying frame
15849     *     bias, precession and nutation in that order.
15850     *
15851     * <li> It is permissible to re-use the same array in the returned
15852     *     arguments.  The arrays are filled in the order given.
15853     *</ol>
15854     *<p>Called:<ul>
15855     *     <li>{@link #jauPr00} IAU 2000 precession adjustments
15856     *     <li>{@link #jauObl80} mean obliquity, IAU 1980
15857     *     <li>{@link #jauBp00} frame bias and precession matrices, IAU 2000
15858     *     <li>{@link #jauCr} copy r-matrix
15859     *     <li>{@link #jauNumat} form nutation matrix
15860     *     <li>{@link #jauRxr} product of two r-matrices
15861     * </ul>
15862     *<p>Reference:
15863     *
15864     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
15865     *     "Expressions for the Celestial Intermediate Pole and Celestial
15866     *     Ephemeris Origin consistent with the IAU 2000A precession-
15867     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
15868     *
15869     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
15870     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
15871     *
15872     *@version 2010 January 18
15873     *
15874     *  @since Release 20101201
15875     *
15876     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
15877     */
15878     public static PrecessionNutation  jauPn00(double date1, double date2, double dpsi, double deps)
15879     {
15880        double  rbpw[][] = new double[3][3], rnw[][] = new double[3][3];
15881        double[][] rb = new double[3][3];
15882        double[][] rp = new double[3][3];
15883        double[][] rbp = new double[3][3];
15884        double[][] rn = new double[3][3];
15885        double[][] rbpn = new double[3][3];
15886 
15887 
15888     /* IAU 2000 precession-rate adjustments. */
15889        PrecessionDeltaTerms nut = jauPr00(date1, date2);
15890 
15891     /* Mean obliquity, consistent with IAU 2000 precession-nutation. */
15892        double epsa = jauObl80(date1, date2) + nut.depspr;
15893 
15894     /* Frame bias and precession matrices and their product. */
15895        jauBp00(date1, date2, rb, rp, rbpw);
15896        jauCr(rbpw, rbp);
15897 
15898     /* Nutation matrix. */
15899        rnw = jauNumat(epsa, dpsi, deps);
15900        jauCr(rnw, rn);
15901 
15902     /* Bias-precession-nutation matrix (classical). */
15903        rbpn = jauRxr(rnw, rbpw);
15904 
15905        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
15906 
15907         }
15908     
15909 
15910     /**
15911      * Precession-nutation model. 
15912      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
15913      * 
15914      * @since AIDA Stage 1
15915      */
15916     public static class PrecessionNutation {
15917         public NutationTerms nut;
15918         /** mean obliquity */
15919         public  double epsa;
15920         /** frame bias matrix */
15921         public double rb[][];
15922         /** precession matrix  */
15923         public  double rp[][];
15924         /** bias-precession matrix */
15925         public  double rbp[][];
15926         /** nutation matrix  */
15927         public double rn[][];
15928         /** GCRS-to-true matrix */
15929         public double rbpn[][];
15930         public PrecessionNutation(double dpsi, double deps, double epsa,
15931                   double rb[][], double rp[][], double rbp[][],
15932                   double rn[][], double rbpn[][]){
15933             this.nut = new NutationTerms(dpsi, deps);
15934             this.epsa = epsa;
15935             this.rb = rb; 
15936             this.rp = rp;
15937             this.rbp = rbp;
15938             this.rn = rn;
15939             this.rbpn = rbpn;
15940         }
15941         
15942     }
15943     /**
15944     *  Precession-nutation, IAU 2000A model:  a multi-purpose function,
15945     *  supporting classical (equinox-based) use directly and CIO-based
15946     *  use indirectly.
15947     *
15948     *<p>This function is derived from the International Astronomical Union's
15949     *  SOFA (Standards Of Fundamental Astronomy) software collection.
15950     *
15951     *<p>Status:  support function.
15952     *
15953     *<!-- Given: -->
15954     *     @param date1 double TT as a 2-part Julian Date (Note 1)
15955     *     @param date2 double TT as a 2-part Julian Date (Note 1)
15956     *
15957     *<!-- Returned: -->
15958     *     @return dpsi double            <u>returned</u> nutation (Note 2)
15959     *             deps double            <u>returned</u> nutation (Note 2) 
15960     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
15961     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
15962     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
15963     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
15964     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
15965     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
15966     *
15967     * <p>Notes:
15968     * <ol>
15969     *
15970     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
15971     *      convenient way between the two arguments.  For example,
15972     *      JD(TT)=2450123.7 could be expressed in any of these ways,
15973     *      among others:
15974     *<pre>
15975     *             date1          date2
15976     *
15977     *          2450123.7           0.0       (JD method)
15978     *          2451545.0       -1421.3       (J2000 method)
15979     *          2400000.5       50123.2       (MJD method)
15980     *          2450123.5           0.2       (date &amp; time method)
15981     *</pre>
15982     *      The JD method is the most natural and convenient to use in
15983     *      cases where the loss of several decimal digits of resolution
15984     *      is acceptable.  The J2000 method is best matched to the way
15985     *      the argument is handled internally and will deliver the
15986     *      optimum resolution.  The MJD method and the date &amp; time methods
15987     *      are both good compromises between resolution and convenience.
15988     *
15989     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
15990     *      longitude and obliquity are in radians and with respect to the
15991     *      equinox and ecliptic of date.  Free core nutation is omitted;
15992     *      for the utmost accuracy, use the jauPn00  function, where the
15993     *      nutation components are caller-specified.  For faster but
15994     *      slightly less accurate results, use the jauPn00b function.
15995     *
15996     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
15997     *
15998     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
15999     *      equator and equinox by applying frame bias.
16000     *
16001     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16002     *      equinox to mean equator and equinox of date by applying
16003     *      precession.
16004     *
16005     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16006     *      equinox of date by applying frame bias then precession.  It is
16007     *      the product rp x rb.
16008     *
16009     * <li>  The matrix rn transforms vectors from mean equator and equinox
16010     *      of date to true equator and equinox of date by applying the
16011     *      nutation (luni-solar + planetary).
16012     *
16013     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16014     *      equinox of date.  It is the product rn x rbp, applying frame
16015     *      bias, precession and nutation in that order.
16016     *
16017     * <li>  The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate
16018     *      Pole are elements (3,1-3) of the GCRS-to-true matrix,
16019     *       i.e. rbpn[2][0-2].
16020     *
16021     *  <li> It is permissible to re-use the same array in the returned
16022     *      arguments.  The arrays are filled in the order given.
16023     *</ol>
16024     *<p>Called:<ul>
16025     *     <li>{@link #jauNut00a} nutation, IAU 2000A
16026     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16027     * </ul>
16028     *<p>Reference:
16029     *
16030     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16031     *     "Expressions for the Celestial Intermediate Pole and Celestial
16032     *     Ephemeris Origin consistent with the IAU 2000A precession-
16033     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
16034     *
16035     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16036     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16037     *
16038     *@version 2010 January 18
16039     *
16040     *  @since Release 20101201
16041     *
16042     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16043     */
16044     public static PrecessionNutation jauPn00a(double date1, double date2)
16045     {
16046     /* Nutation. */
16047        NutationTerms nut = jauNut00a(date1, date2);
16048 
16049     /* Remaining results. */
16050        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16051 
16052  
16053         }
16054     
16055 
16056     /**
16057     *  Precession-nutation, IAU 2000B model:  a multi-purpose function,
16058     *  supporting classical (equinox-based) use directly and CIO-based
16059     *  use indirectly.
16060     *
16061     *<p>This function is derived from the International Astronomical Union's
16062     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16063     *
16064     *<p>Status:  support function.
16065     *
16066     *<!-- Given: -->
16067     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16068     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16069     *
16070     *<!-- Returned: -->
16071     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16072     *             epsa          double            <u>returned</u> mean obliquity (Note 3)
16073     *             rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16074     *             rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16075     *             rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16076     *             rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16077     *             rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16078     *
16079     * <p>Notes:
16080     * <ol>
16081     *
16082     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16083     *      convenient way between the two arguments.  For example,
16084     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16085     *      among others:
16086     *<pre>
16087     *             date1          date2
16088     *
16089     *          2450123.7           0.0       (JD method)
16090     *          2451545.0       -1421.3       (J2000 method)
16091     *          2400000.5       50123.2       (MJD method)
16092     *          2450123.5           0.2       (date &amp; time method)
16093     *</pre>
16094     *      The JD method is the most natural and convenient to use in
16095     *      cases where the loss of several decimal digits of resolution
16096     *      is acceptable.  The J2000 method is best matched to the way
16097     *      the argument is handled internally and will deliver the
16098     *      optimum resolution.  The MJD method and the date &amp; time methods
16099     *      are both good compromises between resolution and convenience.
16100     *
16101     * <li>  The nutation components (luni-solar + planetary, IAU 2000B) in
16102     *      longitude and obliquity are in radians and with respect to the
16103     *      equinox and ecliptic of date.  For more accurate results, but
16104     *      at the cost of increased computation, use the jauPn00a function.
16105     *      For the utmost accuracy, use the jauPn00  function, where the
16106     *      nutation components are caller-specified.
16107     *
16108     * <li>  The mean obliquity is consistent with the IAU 2000 precession.
16109     *
16110     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16111     *      equator and equinox by applying frame bias.
16112     *
16113     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16114     *      equinox to mean equator and equinox of date by applying
16115     *      precession.
16116     *
16117     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16118     *      equinox of date by applying frame bias then precession.  It is
16119     *      the product rp x rb.
16120     *
16121     * <li>  The matrix rn transforms vectors from mean equator and equinox
16122     *      of date to true equator and equinox of date by applying the
16123     *      nutation (luni-solar + planetary).
16124     *
16125     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16126     *      equinox of date.  It is the product rn x rbp, applying frame
16127     *      bias, precession and nutation in that order.
16128     *
16129     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16130     *      Pole are elements (3,1-3) of the matrix rbpn.
16131     *
16132     * <li> It is permissible to re-use the same array in the returned
16133     *      arguments.  The arrays are filled in the stated order.
16134     *</ol>
16135     *<p>Called:<ul>
16136     *     <li>{@link #jauNut00b} nutation, IAU 2000B
16137     *     <li>{@link #jauPn00} bias/precession/nutation results, IAU 2000
16138     * </ul>
16139     *<p>Reference:
16140     *
16141     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
16142     *     "Expressions for the Celestial Intermediate Pole and Celestial
16143     *     Ephemeris Origin consistent with the IAU 2000A precession-
16144     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003).
16145     *
16146     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
16147     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
16148     *
16149     *@version 2010 January 18
16150     *
16151     *  @since Release 20101201
16152     *
16153     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16154     */
16155     public static PrecessionNutation jauPn00b(double date1, double date2)
16156     {
16157     /* Nutation. */
16158        NutationTerms nut = jauNut00b(date1, date2);
16159 
16160     /* Remaining results. */
16161        return jauPn00(date1, date2, nut.dpsi, nut.deps);
16162 
16163 
16164         }
16165     
16166 
16167     /**
16168     *  Precession-nutation, IAU 2006 model:  a multi-purpose function,
16169     *  supporting classical (equinox-based) use directly and CIO-based use
16170     *  indirectly.
16171     *
16172     *<p>This function is derived from the International Astronomical Union's
16173     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16174     *
16175     *<p>Status:  support function.
16176     *
16177     *<!-- Given: -->
16178     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16179     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16180     *     @param dpsi double           nutation (Note 2)
16181     *     @param deps double           nutation (Note 2) 
16182     *
16183     *<!-- Returned: -->
16184     *     @return epsa          double            <u>returned</u> mean obliquity (Note 3)
16185     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16186     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16187     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16188     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16189     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Note 8)
16190     *
16191     * <p>Notes:
16192     * <ol>
16193     *
16194     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16195     *      convenient way between the two arguments.  For example,
16196     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16197     *      among others:
16198     *<pre>
16199     *             date1          date2
16200     *
16201     *          2450123.7           0.0       (JD method)
16202     *          2451545.0       -1421.3       (J2000 method)
16203     *          2400000.5       50123.2       (MJD method)
16204     *          2450123.5           0.2       (date &amp; time method)
16205     *</pre>
16206     *      The JD method is the most natural and convenient to use in
16207     *      cases where the loss of several decimal digits of resolution
16208     *      is acceptable.  The J2000 method is best matched to the way
16209     *      the argument is handled internally and will deliver the
16210     *      optimum resolution.  The MJD method and the date &amp; time methods
16211     *      are both good compromises between resolution and convenience.
16212     *
16213     * <li>  The caller is responsible for providing the nutation components;
16214     *      they are in longitude and obliquity, in radians and are with
16215     *      respect to the equinox and ecliptic of date.  For high-accuracy
16216     *      applications, free core nutation should be included as well as
16217     *      any other relevant corrections to the position of the CIP.
16218     *
16219     * <li>  The returned mean obliquity is consistent with the IAU 2006
16220     *      precession.
16221     *
16222     * <li>  The matrix rb transforms vectors from GCRS to J2000.0 mean
16223     *      equator and equinox by applying frame bias.
16224     *
16225     * <li>  The matrix rp transforms vectors from J2000.0 mean equator and
16226     *      equinox to mean equator and equinox of date by applying
16227     *      precession.
16228     *
16229     * <li>  The matrix rbp transforms vectors from GCRS to mean equator and
16230     *      equinox of date by applying frame bias then precession.  It is
16231     *      the product rp x rb.
16232     *
16233     * <li>  The matrix rn transforms vectors from mean equator and equinox
16234     *      of date to true equator and equinox of date by applying the
16235     *      nutation (luni-solar + planetary).
16236     *
16237     * <li>  The matrix rbpn transforms vectors from GCRS to true equator and
16238     *      equinox of date.  It is the product rn x rbp, applying frame
16239     *      bias, precession and nutation in that order.
16240     *
16241     * <li>  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
16242     *      Pole are elements (3,1-3) of the matrix rbpn.
16243     *
16244     *  <li> It is permissible to re-use the same array in the returned
16245     *      arguments.  The arrays are filled in the stated order.
16246     *</ol>
16247     *<p>Called:<ul>
16248     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16249     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16250     *     <li>{@link #jauCr} copy r-matrix
16251     *     <li>{@link #jauTr} transpose r-matrix
16252     *     <li>{@link #jauRxr} product of two r-matrices
16253     * </ul>
16254     *<p>References:
16255     *
16256     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16257     *
16258     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
16259     *
16260     *@version 2009 December 17
16261     *
16262     *  @since Release 20101201
16263     *
16264     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16265     */
16266     public static PrecessionNutation jauPn06(double date1, double date2, double dpsi, double deps)
16267     {
16268 
16269         double rb[][] = new double[3][3], rbp[][] = new double[3][3], rbpn[][] = new double[3][3];
16270     /* Bias-precession Fukushima-Williams angles of J2000.0 = frame bias. */
16271        FWPrecessionAngles fw = jauPfw06(DJM0, DJM00);
16272 
16273     /* B matrix. */
16274        double[][] r1 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa);
16275        jauCr(r1, rb);
16276 
16277     /* Bias-precession Fukushima-Williams angles of date. */
16278        fw = jauPfw06(date1, date2);
16279 
16280     /* Bias-precession matrix. */
16281        double[][] r2 = jauFw2m(fw.gamb, fw.phib, fw.psib, fw.epsa );
16282        jauCr(r2, rbp);
16283 
16284     /* Solve for precession matrix. */
16285        double[][] rt = jauTr(r1);
16286        double[][] rp = jauRxr(r2, rt);
16287 
16288     /* Equinox-based bias-precession-nutation matrix. */
16289        r1 = jauFw2m(fw.gamb, fw.phib, fw.psib + dpsi, fw.epsa + deps);
16290        jauCr(r1, rbpn);
16291 
16292     /* Solve for nutation matrix. */
16293        rt = jauTr(r2);
16294        double[][] rn = jauRxr(r1, rt);
16295 
16296     /* Obliquity, mean of date. */
16297        double epsa = fw.epsa;
16298 
16299        return new PrecessionNutation(dpsi, deps, epsa, rb, rp, rbp, rn, rbpn);
16300 
16301         }
16302     
16303 
16304     /**
16305     *  Precession-nutation, IAU 2006/2000A models:  a multi-purpose function,
16306     *  supporting classical (equinox-based) use directly and CIO-based use
16307     *  indirectly.
16308     *
16309     *<p>This function is derived from the International Astronomical Union's
16310     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16311     *
16312     *<p>Status:  support function.
16313     *
16314     *<!-- Given: -->
16315     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16316     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16317     *
16318     *<!-- Returned: -->
16319     *     @return dpsi,deps     double            <u>returned</u> nutation (Note 2)
16320     *            epsa          double            <u>returned</u> mean obliquity (Note 3)
16321     *            rb            double[3][3]      <u>returned</u> frame bias matrix (Note 4)
16322     *            rp            double[3][3]      <u>returned</u> precession matrix (Note 5)
16323     *            rbp           double[3][3]      <u>returned</u> bias-precession matrix (Note 6)
16324     *            rn            double[3][3]      <u>returned</u> nutation matrix (Note 7)
16325     *            rbpn          double[3][3]      <u>returned</u> GCRS-to-true matrix (Notes 8,9)
16326     *
16327     * <p>Notes:
16328     * <ol>
16329     *
16330     * <li>  The TT date date1+date2 is a Julian Date, apportioned in any
16331     *      convenient way between the two arguments.  For example,
16332     *      JD(TT)=2450123.7 could be expressed in any of these ways,
16333     *      among others:
16334     *<pre>
16335     *             date1          date2
16336     *
16337     *          2450123.7           0.0       (JD method)
16338     *          2451545.0       -1421.3       (J2000 method)
16339     *          2400000.5       50123.2       (MJD method)
16340     *          2450123.5           0.2       (date &amp; time method)
16341     *</pre>
16342     *      The JD method is the most natural and convenient to use in
16343     *      cases where the loss of several decimal digits of resolution
16344     *      is acceptable.  The J2000 method is best matched to the way
16345     *      the argument is handled internally and will deliver the
16346     *      optimum resolution.  The MJD method and the date &amp; time methods
16347     *      are both good compromises between resolution and convenience.
16348     *
16349     * <li>  The nutation components (luni-solar + planetary, IAU 2000A) in
16350     *      longitude and obliquity are in radians and with respect to the
16351     *      equinox and ecliptic of date.  Free core nutation is omitted;
16352     *      for the utmost accuracy, use the jauPn06 function, where the
16353     *      nutation components are caller-specified.
16354     *
16355     * <li>  The mean obliquity is consistent with the IAU 2006 precession.
16356     *
16357     * <li>  The matrix rb transforms vectors from GCRS to mean J2000.0 by
16358     *      applying frame bias.
16359     *
16360     * <li>  The matrix rp transforms vectors from mean J2000.0 to mean of
16361     *      date by applying precession.
16362     *
16363     * <li>  The matrix rbp transforms vectors from GCRS to mean of date by
16364     *      applying frame bias then precession.  It is the product rp x rb.
16365     *
16366     * <li>  The matrix rn transforms vectors from mean of date to true of
16367     *      date by applying the nutation (luni-solar + planetary).
16368     *
16369     * <li>  The matrix rbpn transforms vectors from GCRS to true of date
16370     *      (CIP/equinox).  It is the product rn x rbp, applying frame bias,
16371     *      precession and nutation in that order.
16372     *
16373     * <li>  The X,Y,Z coordinates of the IAU 2006/2000A Celestial
16374     *      Intermediate Pole are elements (1,1-3) of the matrix rbpn.
16375     *
16376     *  <li> It is permissible to re-use the same array in the returned
16377     *      arguments.  The arrays are filled in the stated order.
16378     *</ol>
16379     *<p>Called:<ul>
16380     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16381     *     <li>{@link #jauPn06} bias/precession/nutation results, IAU 2006
16382     * </ul>
16383     *<p>Reference:
16384     *
16385     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
16386     *
16387     *@version 2009 December 18
16388     *
16389     *  @since Release 20101201
16390     *
16391     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16392     */
16393     public static PrecessionNutation jauPn06a(double date1, double date2)
16394     {
16395     /* Nutation. */
16396        NutationTerms nut = jauNut06a(date1, date2);
16397 
16398     /* Remaining results. */
16399        return jauPn06(date1, date2, nut.dpsi, nut.deps);
16400 
16401         }
16402     
16403 
16404     /**
16405     *  Form the matrix of precession-nutation for a given date (including
16406     *  frame bias), equinox-based, IAU 2000A model.
16407     *
16408     *<p>This function is derived from the International Astronomical Union's
16409     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16410     *
16411     *<p>Status:  support function.
16412     *
16413     *<!-- Given: -->
16414     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16415     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16416     *
16417     *<!-- Returned: -->
16418     *     @return rbpn          double[3][3]      <u>returned</u> classical NPB matrix (Note 2)
16419     *
16420     * <p>Notes:
16421     * <ol>
16422     *
16423     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16424     *     convenient way between the two arguments.  For example,
16425     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16426     *     among others:
16427     *<pre>
16428     *            date1          date2
16429     *
16430     *         2450123.7           0.0       (JD method)
16431     *         2451545.0       -1421.3       (J2000 method)
16432     *         2400000.5       50123.2       (MJD method)
16433     *         2450123.5           0.2       (date &amp; time method)
16434     *</pre>
16435     *     The JD method is the most natural and convenient to use in
16436     *     cases where the loss of several decimal digits of resolution
16437     *     is acceptable.  The J2000 method is best matched to the way
16438     *     the argument is handled internally and will deliver the
16439     *     optimum resolution.  The MJD method and the date &amp; time methods
16440     *     are both good compromises between resolution and convenience.
16441     *
16442     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16443     *     the p-vector V(date) is with respect to the true equatorial triad
16444     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16445     *     the Geocentric Celestial Reference System (IAU, 2000).
16446     *
16447     * <li> A faster, but slightly less accurate result (about 1 mas), can be
16448     *     obtained by using instead the jauPnm00b function.
16449     *</ol>
16450     *<p>Called:<ul>
16451     *     <li>{@link #jauPn00a} bias/precession/nutation, IAU 2000A
16452     * </ul>
16453     *<p>Reference:
16454     *
16455     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16456     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16457     *     (2000)
16458     *
16459     *@version 2009 December 21
16460     *
16461     *  @since Release 20101201
16462     *
16463     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16464     */
16465     public static double[][] jauPnm00a(double date1, double date2)
16466     {
16467 
16468     /* Obtain the required matrix (discarding other results). */
16469         PrecessionNutation pn = jauPn00a(date1, date2);
16470         return pn.rbpn;
16471 
16472     }
16473 
16474 
16475     /**
16476     *  Form the matrix of precession-nutation for a given date (including
16477     *  frame bias), equinox-based, IAU 2000B model.
16478     *
16479     *<p>This function is derived from the International Astronomical Union's
16480     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16481     *
16482     *<p>Status:  support function.
16483     *
16484     *<!-- Given: -->
16485     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16486     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16487     *
16488     *<!-- Returned: -->
16489     *     @return rbpn         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16490     *
16491     * <p>Notes:
16492     * <ol>
16493     *
16494     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16495     *     convenient way between the two arguments.  For example,
16496     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16497     *     among others:
16498     *<pre>
16499     *            date1          date2
16500     *
16501     *         2450123.7           0.0       (JD method)
16502     *         2451545.0       -1421.3       (J2000 method)
16503     *         2400000.5       50123.2       (MJD method)
16504     *         2450123.5           0.2       (date &amp; time method)
16505     *</pre>
16506     *     The JD method is the most natural and convenient to use in
16507     *     cases where the loss of several decimal digits of resolution
16508     *     is acceptable.  The J2000 method is best matched to the way
16509     *     the argument is handled internally and will deliver the
16510     *     optimum resolution.  The MJD method and the date &amp; time methods
16511     *     are both good compromises between resolution and convenience.
16512     *
16513     * <li> The matrix operates in the sense V(date) = rbpn * V(GCRS), where
16514     *     the p-vector V(date) is with respect to the true equatorial triad
16515     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16516     *     the Geocentric Celestial Reference System (IAU, 2000).
16517     *
16518     * <li> The present function is faster, but slightly less accurate (about
16519     *     1 mas), than the jauPnm00a function.
16520     *</ol>
16521     *<p>Called:<ul>
16522     *     <li>{@link #jauPn00b} bias/precession/nutation, IAU 2000B
16523     * </ul>
16524     *<p>Reference:
16525     *
16526     *     IAU: Trans. International Astronomical Union, Vol. XXIVB;  Proc.
16527     *     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
16528     *     (2000)
16529     *
16530     *@version 2009 December 21
16531     *
16532     *  @since Release 20101201
16533     *
16534     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16535     */
16536     public static double[][] jauPnm00b(double date1, double date2)
16537     {
16538 
16539     /* Obtain the required matrix (discarding other results). */
16540        PrecessionNutation pn = jauPn00b(date1, date2);
16541 
16542        return pn.rbpn;
16543 
16544         }
16545     
16546 
16547     /**
16548     *  Form the matrix of precession-nutation for a given date (including
16549     *  frame bias), IAU 2006 precession and IAU 2000A nutation models.
16550     *
16551     *<p>This function is derived from the International Astronomical Union's
16552     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16553     *
16554     *<p>Status:  support function.
16555     *
16556     *<!-- Given: -->
16557     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16558     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16559     *
16560     *<!-- Returned: -->
16561     *     @return rnpb         double[3][3]   <u>returned</u> bias-precession-nutation matrix (Note 2)
16562     *
16563     * <p>Notes:
16564     * <ol>
16565     *
16566     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16567     *     convenient way between the two arguments.  For example,
16568     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16569     *     among others:
16570     *<pre>
16571     *            date1          date2
16572     *
16573     *         2450123.7           0.0       (JD method)
16574     *         2451545.0       -1421.3       (J2000 method)
16575     *         2400000.5       50123.2       (MJD method)
16576     *         2450123.5           0.2       (date &amp; time method)
16577     *</pre>
16578     *     The JD method is the most natural and convenient to use in
16579     *     cases where the loss of several decimal digits of resolution
16580     *     is acceptable.  The J2000 method is best matched to the way
16581     *     the argument is handled internally and will deliver the
16582     *     optimum resolution.  The MJD method and the date &amp; time methods
16583     *     are both good compromises between resolution and convenience.
16584     *
16585     * <li> The matrix operates in the sense V(date) = rnpb * V(GCRS), where
16586     *     the p-vector V(date) is with respect to the true equatorial triad
16587     *     of date date1+date2 and the p-vector V(GCRS) is with respect to
16588     *     the Geocentric Celestial Reference System (IAU, 2000).
16589     *</ol>
16590     *<p>Called:<ul>
16591     *     <li>{@link #jauPfw06} bias-precession F-W angles, IAU 2006
16592     *     <li>{@link #jauNut06a} nutation, IAU 2006/2000A
16593     *     <li>{@link #jauFw2m} F-W angles to r-matrix
16594     * </ul>
16595     *<p>Reference:
16596     *
16597     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855.
16598     *
16599     *@version 2009 December 21
16600     *
16601     *  @since Release 20101201
16602     *
16603     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16604     */
16605     public static double[][] jauPnm06a(double date1, double date2)
16606     {
16607 
16608     /* Fukushima-Williams angles for frame bias and precession. */
16609        FWPrecessionAngles fw = jauPfw06(date1, date2);
16610 
16611     /* Nutation components. */
16612        NutationTerms nut = jauNut06a(date1, date2);
16613 
16614     /* Equinox based nutation x precession x bias matrix. */
16615        double[][] rnpb = jauFw2m(fw.gamb, fw.phib, fw.psib + nut.dpsi, fw.epsa + nut.deps);
16616 
16617        return rnpb;
16618 
16619         }
16620     
16621 
16622     /**
16623     *  Form the matrix of precession/nutation for a given date, IAU 1976
16624     *  precession model, IAU 1980 nutation model.
16625     *
16626     *<p>This function is derived from the International Astronomical Union's
16627     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16628     *
16629     *<p>Status:  support function.
16630     *
16631     *<!-- Given: -->
16632     *     @param date1 double          TDB date (Note 1)
16633     *     @param date2 double          TDB date (Note 1) 
16634     *
16635     *<!-- Returned: -->
16636     *     @return rmatpn          double[3][3]     <u>returned</u> combined precession/nutation matrix
16637     *
16638     * <p>Notes:
16639     * <ol>
16640     *
16641     * <li> The TDB date date1+date2 is a Julian Date, apportioned in any
16642     *     convenient way between the two arguments.  For example,
16643     *     JD(TDB)=2450123.7 could be expressed in any of these ways,
16644     *     among others:
16645     *<pre>
16646     *            date1          date2
16647     *
16648     *         2450123.7           0.0       (JD method)
16649     *         2451545.0       -1421.3       (J2000 method)
16650     *         2400000.5       50123.2       (MJD method)
16651     *         2450123.5           0.2       (date &amp; time method)
16652     *</pre>
16653     *     The JD method is the most natural and convenient to use in
16654     *     cases where the loss of several decimal digits of resolution
16655     *     is acceptable.  The J2000 method is best matched to the way
16656     *     the argument is handled internally and will deliver the
16657     *     optimum resolution.  The MJD method and the date &amp; time methods
16658     *     are both good compromises between resolution and convenience.
16659     *
16660     * <li> The matrix operates in the sense V(date) = rmatpn * V(J2000),
16661     *     where the p-vector V(date) is with respect to the true equatorial
16662     *     triad of date date1+date2 and the p-vector V(J2000) is with
16663     *     respect to the mean equatorial triad of epoch J2000.0.
16664     *</ol>
16665     *<p>Called:<ul>
16666     *     <li>{@link #jauPmat76} precession matrix, IAU 1976
16667     *     <li>{@link #jauNutm80} nutation matrix, IAU 1980
16668     *     <li>{@link #jauRxr} product of two r-matrices
16669     * </ul>
16670     *<p>Reference:
16671     *
16672     *     <p>Explanatory Supplement to the Astronomical Almanac,
16673     *     P. Kenneth Seidelmann (ed), University Science Books (1992),
16674     *     Section 3.3 (p145).
16675     *
16676     *@version 2010 January 23
16677     *
16678     *  @since Release 20101201
16679     *
16680     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16681     */
16682     public static double[][] jauPnm80(double date1, double date2)
16683     {
16684        double rmatp[][] = new double[3][3], rmatn[][] = new double[3][3];
16685 
16686 
16687     /* Precession matrix, J2000.0 to date. */
16688        rmatp = jauPmat76(date1, date2 );
16689 
16690     /* Nutation matrix. */
16691        rmatn = jauNutm80(date1, date2);
16692 
16693     /* Combine the matrices:  PN = N x P. */
16694        double[][] rmatpn = jauRxr(rmatn, rmatp);
16695 
16696        return rmatpn;
16697 
16698         }
16699     
16700 
16701     /**
16702     *  Form the matrix of polar motion for a given date, IAU 2000.
16703     *
16704     *<p>This function is derived from the International Astronomical Union's
16705     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16706     *
16707     *<p>Status:  support function.
16708     *
16709     *<!-- Given: -->
16710     *     @param xp double     coordinates of the pole (radians, Note 1)
16711     *     @param yp double     coordinates of the pole (radians, Note 1) 
16712     *     @param sp        double     the TIO locator s' (radians, Note 2)
16713     *
16714     *<!-- Returned: -->
16715     *     @return     double[3][3]     <u>returned</u> polar-motion matrix (Note 3)
16716     *
16717     * <p>Notes:
16718     * <ol>
16719     *
16720     * <li> The arguments xp and yp are the coordinates (in radians) of the
16721     *     Celestial Intermediate Pole with respect to the International
16722     *     Terrestrial Reference System (see IERS Conventions 2003),
16723     *     measured along the meridians to 0 and 90 deg west respectively.
16724     *
16725     * <li> The argument sp is the TIO locator s', in radians, which
16726     *     positions the Terrestrial Intermediate Origin on the equator.  It
16727     *     is obtained from polar motion observations by numerical
16728     *     integration, and so is in essence unpredictable.  However, it is
16729     *     dominated by a secular drift of about 47 microarcseconds per
16730     *     century, and so can be taken into account by using s' = -47*t,
16731     *     where t is centuries since J2000.0.  The function jauSp00
16732     *     implements this approximation.
16733     *
16734     * <li> The matrix operates in the sense V(TRS) = rpom * V(CIP), meaning
16735     *     that it is the final rotation when computing the pointing
16736     *     direction to a celestial source.
16737     *</ol>
16738     *<p>Called:<ul>
16739     *     <li>{@link #jauIr} initialize r-matrix to identity
16740     *     <li>{@link #jauRz} rotate around Z-axis
16741     *     <li>{@link #jauRy} rotate around Y-axis
16742     *     <li>{@link #jauRx} rotate around X-axis
16743     * </ul>
16744     *<p>Reference:
16745     *
16746     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
16747     *     IERS Technical Note No. 32, BKG (2004)
16748     *
16749     *@version 2009 December 17
16750     *
16751     *  @since Release 20101201
16752     *
16753     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16754     */
16755     public static double[][] jauPom00(double xp, double yp, double sp)
16756     {
16757 
16758     /* Construct the matrix. */
16759        double rpom[][] = new double[3][3];
16760        jauIr(rpom);
16761        jauRz(sp, rpom);
16762        jauRy(-xp, rpom);
16763        jauRx(-yp, rpom);
16764 
16765        return rpom;
16766 
16767         }
16768     
16769 
16770     /**
16771     *  P-vector addition.
16772     *
16773     *<p>This function is derived from the International Astronomical Union's
16774     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16775     *
16776     *<p>Status:  vector/matrix support function.
16777     *
16778     *<!-- Given: -->
16779     *     @param a         double[3]       first p-vector
16780     *     @param b         double[3]       second p-vector
16781     *
16782     *<!-- Returned: -->
16783     *     @return apb       double[3]        <u>returned</u> a + b
16784     *
16785     *  Note:
16786     *     It is permissible to re-use the same array for any of the
16787     *     arguments.
16788     *
16789     *@version 2008 November 18
16790     *
16791     *  @since Release 20101201
16792     *
16793     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16794     */
16795     public static double[] jauPpp(double a[] , double b[] )
16796     {
16797        double apb[] = new double[3]; 
16798        apb[0] = a[0] + b[0];
16799        apb[1] = a[1] + b[1];
16800        apb[2] = a[2] + b[2];
16801 
16802        return apb;
16803 
16804      }
16805     
16806 
16807     /**
16808     *  P-vector plus scaled p-vector.
16809     *
16810     *<p>This function is derived from the International Astronomical Union's
16811     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16812     *
16813     *<p>Status:  vector/matrix support function.
16814     *
16815     *<!-- Given: -->
16816     *     @param a       double[3]      first p-vector
16817     *     @param s       double         scalar (multiplier for b)
16818     *     @param b       double[3]      second p-vector
16819     *
16820     *<!-- Returned: -->
16821     *     @return apsb    double[3]       <u>returned</u> a + s*b
16822     *
16823     *  Note:
16824     *     It is permissible for any of a, b and apsb to be the same array.
16825     *
16826     *<p>Called:<ul>
16827     *     <li>{@link #jauSxp} multiply p-vector by scalar
16828     *     <li>{@link #jauPpp} p-vector plus p-vector
16829     * </ul>
16830     *@version 2008 November 18
16831     *
16832     *  @since Release 20101201
16833     *
16834     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16835     */
16836     static double[] jauPpsp(double a[] , double s, double b[]  )
16837     {
16838        double sb[] = new double[3], apsb[];
16839 
16840 
16841     /* s*b. */
16842        sb = jauSxp(s,b);
16843 
16844     /* a + s*b. */
16845        apsb = jauPpp(a, sb);
16846 
16847        return apsb;
16848 
16849         }
16850     
16851     /**
16852      * Precession correction terms.
16853      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16854      * 
16855      * @since AIDA Stage 1
16856      */
16857     public static class PrecessionDeltaTerms {
16858         /**  precession correction in longitude  */
16859         public double dpsipr;
16860         /**  precession correction in obliquity */
16861         public double depspr;
16862         public PrecessionDeltaTerms(double dpsipr, double depspr) {
16863             this.dpsipr = dpsipr;
16864             this.depspr = depspr;
16865         }
16866     }
16867 
16868     /**
16869     *  Precession-rate part of the IAU 2000 precession-nutation models
16870     *  (part of MHB2000).
16871     *
16872     *<p>This function is derived from the International Astronomical Union's
16873     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16874     *
16875     *<p>Status:  canonical model.
16876     *
16877     *<!-- Given: -->
16878     *     @param date1 double TT as a 2-part Julian Date (Note 1)
16879     *     @param date2 double TT as a 2-part Julian Date (Note 1)
16880     *
16881     *<!-- Returned: -->
16882     *     @param dpsipr double    <u>returned</u> precession corrections (Notes 2,3)
16883     *     @param depspr double    <u>returned</u> precession corrections (Notes 2,3) 
16884     *
16885     * <p>Notes:
16886     * <ol>
16887     *
16888     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
16889     *     convenient way between the two arguments.  For example,
16890     *     JD(TT)=2450123.7 could be expressed in any of these ways,
16891     *     among others:
16892     *<pre>
16893     *            date1          date2
16894     *
16895     *         2450123.7           0.0       (JD method)
16896     *         2451545.0       -1421.3       (J2000 method)
16897     *         2400000.5       50123.2       (MJD method)
16898     *         2450123.5           0.2       (date &amp; time method)
16899     *</pre>
16900     *     The JD method is the most natural and convenient to use in
16901     *     cases where the loss of several decimal digits of resolution
16902     *     is acceptable.  The J2000 method is best matched to the way
16903     *     the argument is handled internally and will deliver the
16904     *     optimum resolution.  The MJD method and the date &amp; time methods
16905     *     are both good compromises between resolution and convenience.
16906     *
16907     * <li> The precession adjustments are expressed as "nutation
16908     *     components", corrections in longitude and obliquity with respect
16909     *     to the J2000.0 equinox and ecliptic.
16910     *
16911     * <li> Although the precession adjustments are stated to be with respect
16912     *     to Lieske et al. (1977), the MHB2000 model does not specify which
16913     *     set of Euler angles are to be used and how the adjustments are to
16914     *     be applied.  The most literal and straightforward procedure is to
16915     *     adopt the 4-rotation epsilon_0, psi_A, omega_A, xi_A option, and
16916     *     to add dpsipr to psi_A and depspr to both omega_A and eps_A.
16917     *
16918     * <li> This is an implementation of one aspect of the IAU 2000A nutation
16919     *     model, formally adopted by the IAU General Assembly in 2000,
16920     *     namely MHB2000 (Mathews et al. 2002).
16921     *
16922     *<p>References:
16923     *
16924     *     <p>Lieske, J.H., Lederle, T., Fricke, W. &amp; Morando, B., "Expressions
16925     *     for the precession quantities based upon the IAU (1976) System of
16926     *     Astronomical Constants", Astron.Astrophys., 58, 1-16 (1977)
16927     *
16928     *     <p>Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation
16929     *     and precession   New nutation series for nonrigid Earth and
16930     *     insights into the Earth's interior", J.Geophys.Res., 107, B4,
16931     *     2002.  The MHB2000 code itself was obtained on 9th September 2002
16932     *     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
16933     *
16934     *    <p>Wallace, P.T., "Software for Implementing the IAU 2000
16935     *     Resolutions", in IERS Workshop 5.1 (2002).
16936     *
16937     *@version 2009 December 17
16938     *
16939     *  @since Release 20101201
16940     *
16941     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
16942     */
16943     static PrecessionDeltaTerms jauPr00(double date1, double date2)
16944     {
16945        double t;
16946 
16947     /* Precession and obliquity corrections (radians per century) */
16948        final double PRECOR = -0.29965 * DAS2R,
16949                            OBLCOR = -0.02524 * DAS2R;
16950 
16951 
16952     /* Interval between fundamental epoch J2000.0 and given date (JC). */
16953        t = ((date1 - DJ00) + date2) / DJC;
16954 
16955     /* Precession rate contributions with respect to IAU 1976/80. */
16956        double dpsipr = PRECOR * t;
16957        double depspr = OBLCOR * t;
16958 
16959        return new PrecessionDeltaTerms(dpsipr, depspr);
16960 
16961         }
16962     
16963     /**
16964      * Euler Angles.
16965      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
16966      * 
16967      * @since AIDA Stage 1
16968      */
16969     public static class EulerAngles {
16970         /** 1st rotation: radians cw around z */
16971         public double zeta;
16972         /** 3rd rotation: radians cw around z */
16973         public double z;
16974         /** 2nd rotation: radians ccw around y */
16975         public double theta;
16976         public EulerAngles(double zeta, double z, double theta){
16977             this.zeta = zeta;
16978             this.z = z;
16979             this.theta = theta;
16980         }
16981     }
16982                    
16983     /**
16984     *  IAU 1976 precession model.
16985     *
16986     *  This function forms the three Euler angles which implement general
16987     *  precession between two epochs, using the IAU 1976 model (as for
16988     *  the FK5 catalog).
16989     *
16990     *<p>This function is derived from the International Astronomical Union's
16991     *  SOFA (Standards Of Fundamental Astronomy) software collection.
16992     *
16993     *<p>Status:  canonical model.
16994     *
16995     *<!-- Given: -->
16996     *     @param ep01 double     TDB starting epoch (Note 1)
16997     *     @param ep02 double     TDB starting epoch (Note 1) 
16998     *     @param ep11 double     TDB ending epoch (Note 1)
16999     *     @param ep12 double     TDB ending epoch (Note 1) 
17000     *
17001     *<!-- Returned: -->
17002     *     @param zeta         double      <u>returned</u> 1st rotation: radians cw around z
17003     *     @param z            double      <u>returned</u> 3rd rotation: radians cw around z
17004     *     @param theta        double      <u>returned</u> 2nd rotation: radians ccw around y
17005     *
17006     * <p>Notes:
17007     * <ol>
17008     *
17009     * <li> The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
17010     *     in any convenient way between the arguments epn1 and epn2.  For
17011     *     example, JD(TDB)=2450123.7 could be expressed in any of these
17012     *     ways, among others:
17013     *
17014     *             epn1          epn2
17015     *
17016     *         2450123.7           0.0       (JD method)
17017     *         2451545.0       -1421.3       (J2000 method)
17018     *         2400000.5       50123.2       (MJD method)
17019     *         2450123.5           0.2       (date &amp; time method)
17020     *</pre>
17021     *     The JD method is the most natural and convenient to use in cases
17022     *     where the loss of several decimal digits of resolution is
17023     *     acceptable.  The J2000 method is best matched to the way the
17024     *     argument is handled internally and will deliver the optimum
17025     *     optimum resolution.  The MJD method and the date &amp; time methods
17026     *     are both good compromises between resolution and convenience.
17027     *     The two epochs may be expressed using different methods, but at
17028     *     the risk of losing some resolution.
17029     *
17030     * <li> The accumulated precession angles zeta, z, theta are expressed
17031     *     through canonical polynomials which are valid only for a limited
17032     *     time span.  In addition, the IAU 1976 precession rate is known to
17033     *     be imperfect.  The absolute accuracy of the present formulation
17034     *     is better than 0.1 arcsec from 1960AD to 2040AD, better than
17035     *     1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for
17036     *     the whole of the period 500BC to 3000AD.  The errors exceed
17037     *     10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec
17038     *     outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to
17039     *     8200AD.
17040     *
17041     * <li> The three angles are returned in the conventional order, which
17042     *     is not the same as the order of the corresponding Euler
17043     *     rotations.  The precession matrix is
17044     *     R_3(-z) x R_2(+theta) x R_3(-zeta).
17045     *
17046     *<p>Reference:
17047     *
17048     *     <p>Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations
17049     *     (6) &amp; (7), p283.
17050     *
17051     *@version 2009 December 17
17052     *
17053     *  @since Release 20101201
17054     *
17055     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17056     */
17057     static EulerAngles jauPrec76(double ep01, double ep02, double ep11, double ep12)
17058     {
17059        double t0, t, tas2r, w;
17060 
17061 
17062     /* Interval between fundamental epoch J2000.0 and start epoch (JC). */
17063        t0 = ((ep01 - DJ00) + ep02) / DJC;
17064 
17065     /* Interval over which precession required (JC). */
17066        t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
17067 
17068     /* Euler angles. */
17069        tas2r = t * DAS2R;
17070        w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0;
17071 
17072        double zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r;
17073 
17074        double z = (w + ((1.09468 + 0.000066 * t0) + 0.018203 * t) * t) * tas2r;
17075 
17076        double theta = ((2004.3109 + (-0.85330 - 0.000217 * t0) * t0)
17077               + ((-0.42665 - 0.000217 * t0) - 0.041833 * t) * t) * tas2r;
17078 
17079        return new EulerAngles(zeta, z, theta);
17080 
17081         }
17082     
17083 
17084     /**
17085     *  Discard velocity component of a pv-vector.
17086     *
17087     *<p>This function is derived from the International Astronomical Union's
17088     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17089     *
17090     *<p>Status:  vector/matrix support function.
17091     *
17092     *<!-- Given: -->
17093     *     @param pv       double[2][3]      pv-vector
17094     *
17095     *<!-- Returned: -->
17096     *     @return p        double[3]          <u>returned</u> p-vector
17097     *
17098     *<p>Called:<ul>
17099     *     <li>{@link #jauCp} copy p-vector
17100     * </ul>
17101     *@version 2008 May 11
17102     *
17103     *  @since Release 20101201
17104     *
17105     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17106     */
17107     public static double[] jauPv2p(double pv[][] )
17108     {
17109        double p[] = new double[3];
17110        jauCp(pv[0], p);
17111 
17112        return p;
17113 
17114         }
17115     
17116 
17117     /**
17118      * A position and velocity expressed in spherical polar coordinates.
17119      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17120      * 
17121      * @since AIDA Stage 1
17122      */
17123     public static class SphericalPositionVelocity {
17124         public SphericalPosition pos;
17125         public SphericalPosition vel;
17126         public SphericalPositionVelocity( double theta, double phi, double r,
17127                 double td, double pd, double rd) {
17128             pos = new SphericalPosition(theta, phi, r);
17129             vel = new SphericalPosition(td,pd,rd);
17130         }
17131     }
17132     /**
17133     *  Convert position/velocity from Cartesian to spherical coordinates.
17134     *
17135     *<p>This function is derived from the International Astronomical Union's
17136     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17137     *
17138     *<p>Status:  vector/matrix support function.
17139     *
17140     *<!-- Given: -->
17141     *     @param pv        double[2][3]   pv-vector
17142     *
17143     *<!-- Returned: -->
17144     *     @return theta     double          <u>returned</u> longitude angle (radians)
17145     *             phi       double          <u>returned</u> latitude angle (radians)
17146     *             r         double          <u>returned</u> radial distance
17147     *             td        double          <u>returned</u> rate of change of theta
17148     *             pd        double          <u>returned</u> rate of change of phi
17149     *             rd        double          <u>returned</u> rate of change of r
17150     *
17151     * <p>Notes:
17152     * <ol>
17153     *
17154     * <li> If the position part of pv is null, theta, phi, td and pd
17155     *     are indeterminate.  This is handled by extrapolating the
17156     *     position through unit time by using the velocity part of
17157     *     pv.  This moves the origin without changing the direction
17158     *     of the velocity component.  If the position and velocity
17159     *     components of pv are both null, zeroes are returned for all
17160     *     six results.
17161     *
17162     * <li> If the position is a pole, theta, td and pd are indeterminate.
17163     *     In such cases zeroes are returned for all three.
17164     *</ol>
17165     *@version 2008 October 28
17166     *
17167     *  @since Release 20101201
17168     *
17169     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17170     */
17171     public static SphericalPositionVelocity jauPv2s(double pv[][])
17172     {
17173        double x, y, z, xd, yd, zd, rxy2, rxy, r2, rtrue, rw, xyp;
17174        double theta, phi, r, td, pd, rd;
17175 
17176     /* Components of position/velocity vector. */
17177        x  = pv[0][0];
17178        y  = pv[0][1];
17179        z  = pv[0][2];
17180        xd = pv[1][0];
17181        yd = pv[1][1];
17182        zd = pv[1][2];
17183 
17184     /* Component of r in XY plane squared. */
17185        rxy2 = x*x + y*y;
17186 
17187     /* Modulus squared. */
17188        r2 = rxy2 + z*z;
17189 
17190     /* Modulus. */
17191        rtrue = sqrt(r2);
17192 
17193     /* If null vector, move the origin along the direction of movement. */
17194        rw = rtrue;
17195        if (rtrue == 0.0) {
17196            x = xd;
17197            y = yd;
17198            z = zd;
17199            rxy2 = x*x + y*y;
17200            r2 = rxy2 + z*z;
17201            rw = sqrt(r2);
17202        }
17203 
17204     /* Position and velocity in spherical coordinates. */
17205        rxy = sqrt(rxy2);
17206        xyp = x*xd + y*yd;
17207        if (rxy2 != 0.0) {
17208            theta = atan2(y, x);
17209            phi = atan2(z, rxy);
17210            td = (x*yd - y*xd) / rxy2;
17211            pd = (zd*rxy2 - z*xyp) / (r2*rxy);
17212        } else {
17213            theta = 0.0;
17214            phi = (z != 0.0) ? atan2(z, rxy) : 0.0;
17215            td = 0.0;
17216            pd = 0.0;
17217        }
17218        r = rtrue;
17219        rd = (rw != 0.0) ? (xyp + z*zd) / rw : 0.0;
17220 
17221        return new SphericalPositionVelocity(theta, phi, r, td, pd, rd);
17222 
17223         }
17224     
17225 
17226     /**
17227     *  Inner (=scalar=dot) product of two pv-vectors.
17228     *
17229     *<p>This function is derived from the International Astronomical Union's
17230     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17231     *
17232     *<p>Status:  vector/matrix support function.
17233     *
17234     *<!-- Given: -->
17235     *     @param a         double[2][3]       first pv-vector
17236     *     @param b         double[2][3]       second pv-vector
17237     *
17238     *<!-- Returned: -->
17239     *     @return adb       double[2]           <u>returned</u> a . b (see note)
17240     *
17241     *  Note:
17242     *
17243     *     If the position and velocity components of the two pv-vectors are
17244     *     ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of
17245     *     numbers ( ap . bp , ap . bv + av . bp ).  The two numbers are the
17246     *     dot-product of the two p-vectors and its derivative.
17247     *
17248     *<p>Called:<ul>
17249     *     <li>{@link #jauPdp} scalar product of two p-vectors
17250     * </ul>
17251     *@version 2008 May 22
17252     *
17253     *  @since Release 20101201
17254     *
17255     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17256     */
17257     public static double[] jauPvdpv(double a[][], double b[][] )
17258     {
17259        double adbd, addb, adb[] = new double[2];
17260 
17261 
17262     /* a . b = constant part of result. */
17263        adb[0] = jauPdp(a[0], b[0]);
17264 
17265     /* a . bdot */
17266        adbd = jauPdp(a[0], b[1]);
17267 
17268     /* adot . b */
17269        addb = jauPdp(a[1], b[0]);
17270 
17271     /* Velocity part of result. */
17272        adb[1] = adbd + addb;
17273 
17274        return adb;
17275 
17276         }
17277     
17278 
17279     /**
17280      * Modulus of pv-vector.
17281      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17282      * 
17283      * @since AIDA Stage 1
17284      */
17285     public static class PVModulus{
17286         public double r;
17287         public double s;
17288         public PVModulus( double r, double s){
17289             this.r = r;
17290             this.s = s;
17291         }
17292     }
17293     /**
17294     *  Modulus of pv-vector.
17295     *
17296     *<p>This function is derived from the International Astronomical Union's
17297     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17298     *
17299     *<p>Status:  vector/matrix support function.
17300     *
17301     *<!-- Given: -->
17302     *     @param pv      double[2][3]    pv-vector
17303     *
17304     *<!-- Returned: -->
17305     *     @return           modulus of position component,
17306     *                      modulus of velocity component
17307     *
17308     *<p>Called:<ul>
17309     *     <li>{@link #jauPm} modulus of p-vector
17310     * </ul>
17311     *@version 2008 May 22
17312     *
17313     *  @since Release 20101201
17314     *
17315     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17316     */
17317     public static PVModulus jauPvm(double pv[][])
17318     {
17319     /* Distance. */
17320        double r = jauPm(pv[0]);
17321 
17322     /* Speed. */
17323        double s = jauPm(pv[1]);
17324 
17325        return new PVModulus(r, s);
17326 
17327         }
17328     
17329 
17330     /**
17331     *  Subtract one pv-vector from another.
17332     *
17333     *<p>This function is derived from the International Astronomical Union's
17334     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17335     *
17336     *<p>Status:  vector/matrix support function.
17337     *
17338     *<!-- Given: -->
17339     *     @param a        double[2][3]       first pv-vector
17340     *     @param b        double[2][3]       second pv-vector
17341     *
17342     *<!-- Returned: -->
17343     *     @return      double[2][3]        <u>returned</u> a - b
17344     *
17345     *  Note:
17346     *     It is permissible to re-use the same array for any of the
17347     *     arguments.
17348     *
17349     *<p>Called:<ul>
17350     *     <li>{@link #jauPmp} p-vector minus p-vector
17351     * </ul>
17352     *@version 2008 November 18
17353     *
17354     *  @since Release 20101201
17355     *
17356     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17357     */
17358     public static double[][] jauPvmpv(double a[][], double b[][])
17359     {
17360        double amb[][] = new double[2][3];
17361        amb[0] = jauPmp(a[0], b[0]);
17362        amb[1] = jauPmp(a[1], b[1]);
17363 
17364        return amb;
17365 
17366         }
17367     
17368 
17369     /**
17370     *  Add one pv-vector to another.
17371     *
17372     *<p>This function is derived from the International Astronomical Union's
17373     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17374     *
17375     *<p>Status:  vector/matrix support function.
17376     *
17377     *<!-- Given: -->
17378     *     @param a         double[2][3]       first pv-vector
17379     *     @param b         double[2][3]       second pv-vector
17380     *
17381     *<!-- Returned: -->
17382     *     @return apb       double[2][3]        <u>returned</u> a + b
17383     *
17384     *  Note:
17385     *     It is permissible to re-use the same array for any of the
17386     *     arguments.
17387     *
17388     *<p>Called:<ul>
17389     *     <li>{@link #jauPpp} p-vector plus p-vector
17390     * </ul>
17391     *@version 2008 November 18
17392     *
17393     *  @since Release 20101201
17394     *
17395     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17396     */
17397     public static double[][] jauPvppv(double a[][], double b[][])
17398     {
17399        double apb[][] = new double[2][3];
17400        apb[0] = jauPpp(a[0], b[0]);
17401        apb[1] = jauPpp(a[1], b[1]);
17402 
17403        return apb;
17404 
17405         }
17406     
17407 
17408     /**
17409      * Typical catalogue coordinates. i.e. Position, proper motion, parallax and radial velocity.
17410      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 4 Feb 2010
17411      * 
17412      * @since AIDA Stage 1
17413      */
17414     public static class CatalogCoords {
17415         /** position (radians) */
17416         public SphericalCoordinate pos;
17417         /** proper motion (radians/year)*/
17418         public SphericalCoordinate pm;
17419         /** parallax (arcsec) */
17420         public double px;
17421         /** radial velocity (km/s, positive = receding) */
17422         public double rv;
17423         
17424         public CatalogCoords(double ra, double dec,
17425                 double pmr, double pmd, double px, double rv) {
17426             this.pos = new SphericalCoordinate(ra, dec);
17427             this.pm = new SphericalCoordinate(pmr, pmd);
17428             this.px = px;
17429             this.rv = rv;
17430         }
17431     }
17432     /**
17433     *  Convert star position+velocity vector to catalog coordinates.
17434     *
17435     *<p>This function is derived from the International Astronomical Union's
17436     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17437     *
17438     *<p>Status:  support function.
17439     *
17440     *  Given (Note 1):
17441     *    @param pv     double[2][3]   pv-vector (au, au/day)
17442     *
17443      *
17444     * <!-- Returned (function value): -->
17445     *  @return catalogue value
17446     *  
17447     *  int            status:
17448     *                              0 = OK
17449     *                             -1 = superluminal speed (Note 5)
17450     *                             -2 = null position vector
17451     *
17452     * <p>Notes:
17453     * <ol>
17454     *
17455     * <li> The specified pv-vector is the coordinate direction (and its rate
17456     *     of change) for the date at which the light leaving the star
17457     *     reached the solar-system barycenter.
17458     *
17459     * <li> The star data returned by this function are "observables" for an
17460     *     imaginary observer at the solar-system barycenter.  Proper motion
17461     *     and radial velocity are, strictly, in terms of barycentric
17462     *     coordinate time, TCB.  For most practical applications, it is
17463     *     permissible to neglect the distinction between TCB and ordinary
17464     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
17465     *     limited by the intrinsic accuracy of the proper-motion and
17466     *     radial-velocity data;  moreover, the supplied pv-vector is likely
17467     *     to be merely an intermediate result (for example generated by the
17468     *     function jauStarpv), so that a change of time unit will cancel
17469     *     out overall.
17470     *
17471     *     In accordance with normal star-catalog conventions, the object's
17472     *     right ascension and declination are freed from the effects of
17473     *     secular aberration.  The frame, which is aligned to the catalog
17474     *     equator and equinox, is Lorentzian and centered on the SSB.
17475     *
17476     *     Summarizing, the specified pv-vector is for most stars almost
17477     *     identical to the result of applying the standard geometrical
17478     *     "space motion" transformation to the catalog data.  The
17479     *     differences, which are the subject of the Stumpff paper cited
17480     *     below, are:
17481     *
17482     *     (i) In stars with significant radial velocity and proper motion,
17483     *     the constantly changing light-time distorts the apparent proper
17484     *     motion.  Note that this is a classical, not a relativistic,
17485     *     effect.
17486     *
17487     *     (ii) The transformation complies with special relativity.
17488     *
17489     * <li> Care is needed with units.  The star coordinates are in radians
17490     *     and the proper motions in radians per Julian year, but the
17491     *     parallax is in arcseconds; the radial velocity is in km/s, but
17492     *     the pv-vector result is in au and au/day.
17493     *
17494     * <li> The proper motions are the rate of change of the right ascension
17495     *     and declination at the catalog epoch and are in radians per Julian
17496     *     year.  The RA proper motion is in terms of coordinate angle, not
17497     *     true angle, and will thus be numerically larger at high
17498     *     declinations.
17499     *
17500     * <li> Straight-line motion at constant speed in the inertial frame is
17501     *     assumed.  If the speed is greater than or equal to the speed of
17502     *     light, the function aborts with an error status.
17503     *
17504     * <li> The inverse transformation is performed by the function jauStarpv.
17505     *</ol>
17506     *<p>Called:<ul>
17507     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
17508     *     <li>{@link #jauPdp} scalar product of two p-vectors
17509     *     <li>{@link #jauSxp} multiply p-vector by scalar
17510     *     <li>{@link #jauPmp} p-vector minus p-vector
17511     *     <li>{@link #jauPm} modulus of p-vector
17512     *     <li>{@link #jauPpp} p-vector plus p-vector
17513     *     <li>{@link #jauPv2s} pv-vector to spherical
17514     *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
17515     * </ul>
17516     *<p>Reference:
17517     *
17518     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
17519     *
17520     *@version 2017 May 30
17521     *
17522     *  @since Release 20101201
17523     *
17524     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17525     */
17526     public static CatalogCoords jauPvstar(double pv[][]) throws JSOFAInternalError
17527     {
17528        double x[] = new double[3], vr, ur[] = new double[3], vt, ut[] = new double[3], bett, betr, d, w, del,
17529               usr[] = new double[3], ust[] = new double[3];
17530 
17531 
17532     /* Isolate the radial component of the velocity (au/day, inertial). */
17533        NormalizedVector nv = jauPn(pv[0]);
17534        x = nv.u;
17535        vr = jauPdp(x, pv[1]);
17536        ur = jauSxp(vr,x);
17537 
17538     /* Isolate the transverse component of the velocity (au/day, inertial). */
17539        ut = jauPmp(pv[1], ur);
17540        vt = jauPm(ut);
17541 
17542     /* Special-relativity dimensionless parameters. */
17543        bett = vt / DC;
17544        betr = vr / DC;
17545 
17546     /* The inertial-to-observed correction terms. */
17547        d = 1.0 + betr;
17548        w = betr*betr + bett*bett;
17549        if (d == 0.0 || w > 1) throw new JSOFAInternalError("Superluminal speed", -1);
17550        del = -w / (sqrt(1.0 -w) + 1.0);
17551 
17552     /* Apply relativistic correction factor to radial velocity component. */
17553        w = (betr != 0) ? (betr - del) / (betr * d) : 1.0;
17554        usr = jauSxp(w,ur);
17555 
17556     /* Apply relativistic correction factor to tangential velocity */
17557     /* component.                                                  */
17558        ust = jauSxp(1.0/d, ut);
17559 
17560     /* Combine the two to obtain the observed velocity vector (au/day). */
17561        pv[1] = jauPpp(usr, ust);
17562 
17563     /* Cartesian to spherical. */
17564        SphericalPositionVelocity pvs = jauPv2s(pv);
17565        if (pvs.pos.r == 0.0) throw new JSOFAInternalError("null position vector", -2);
17566 
17567     /* Return RA in range 0 to 2pi. */
17568        double ra = jauAnp(pvs.pos.theta);
17569 
17570     /* Return proper motions in radians per year. */
17571        double pmr = pvs.vel.theta * DJY;
17572        double pmd = pvs.vel.phi * DJY;
17573 
17574     /* Return parallax in arcsec. */
17575        double px = DR2AS / pvs.pos.r;
17576 
17577     /* Return radial velocity in km/s. */
17578        double rv = 1e-3 * pvs.vel.r * DAU / DAYSEC;
17579 
17580     /* OK status. */
17581        return new CatalogCoords(ra, pvs.pos.phi, pmr, pmd, px, rv);
17582 
17583         }
17584     
17585 
17586     /**
17587     *  Update a pv-vector.
17588     *
17589     *<p>This function is derived from the International Astronomical Union's
17590     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17591     *
17592     *<p>Status:  vector/matrix support function.
17593     *
17594     *<!-- Given: -->
17595     *     @param dt        double            time interval
17596     *     @param pv        double[2][3]      pv-vector
17597     *
17598     *<!-- Returned: -->
17599     *     @return upv       double[2][3]       <u>returned</u> p updated, v unchanged
17600     *
17601     * <p>Notes:
17602     * <ol>
17603     *
17604     * <li> "Update" means "refer the position component of the vector
17605     *     to a new date dt time units from the existing date".
17606     *
17607     * <li> The time units of dt must match those of the velocity.
17608     *
17609     * <li> It is permissible for pv and upv to be the same array.
17610     *</ol>
17611     *<p>Called:<ul>
17612     *     <li>{@link #jauPpsp} p-vector plus scaled p-vector
17613     *     <li>{@link #jauCp} copy p-vector
17614     * </ul>
17615     *@version 2008 November 17
17616     *
17617     *  @since Release 20101201
17618     *
17619     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17620     */
17621     public static double[][] jauPvu(double dt, double pv[][] )
17622     {
17623        double upv[][] = new double[2][3];
17624        upv[0] = jauPpsp(pv[0], dt, pv[1]);
17625        jauCp(pv[1], upv[1]);
17626 
17627        return upv;
17628 
17629         }
17630     
17631 
17632     /**
17633     *  Update a pv-vector, discarding the velocity component.
17634     *
17635     *<p>This function is derived from the International Astronomical Union's
17636     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17637     *
17638     *<p>Status:  vector/matrix support function.
17639     *
17640     *<!-- Given: -->
17641     *     @param dt        double             time interval
17642     *     @param pv        double[2][3]       pv-vector
17643     *
17644     *<!-- Returned: -->
17645     *     @return p         double[3]           <u>returned</u> p-vector
17646     *
17647     * <p>Notes:
17648     * <ol>
17649     *
17650     * <li> "Update" means "refer the position component of the vector to a
17651     *     new date dt time units from the existing date".
17652     *
17653     * <li> The time units of dt must match those of the velocity.
17654     *</ol>
17655     *@version 2008 May 11
17656     *
17657     *  @since Release 20101201
17658     *
17659     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17660     */
17661     public static double[] jauPvup(double dt, double pv[][] )
17662     {
17663         double p[] = new double[3];
17664        p[0] = pv[0][0] + dt * pv[1][0];
17665        p[1] = pv[0][1] + dt * pv[1][1];
17666        p[2] = pv[0][2] + dt * pv[1][2];
17667 
17668        return p;
17669 
17670         }
17671     
17672 
17673     /**
17674     *  Outer (=vector=cross) product of two pv-vectors.
17675     *
17676     *<p>This function is derived from the International Astronomical Union's
17677     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17678     *
17679     *<p>Status:  vector/matrix support function.
17680     *
17681     *<!-- Given: -->
17682     *     @param a         double[2][3]       first pv-vector
17683     *     @param b         double[2][3]       second pv-vector
17684     *
17685     *<!-- Returned: -->
17686     *     @return axb       double[2][3]        <u>returned</u> a x b
17687     *
17688     * <p>Notes:
17689     * <ol>
17690     *
17691     * <li> If the position and velocity components of the two pv-vectors are
17692     *     ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of
17693     *     vectors ( ap x bp, ap x bv + av x bp ).  The two vectors are the
17694     *     cross-product of the two p-vectors and its derivative.
17695     *
17696     * <li> It is permissible to re-use the same array for any of the
17697     *     arguments.
17698     *</ol>
17699     *<p>Called:<ul>
17700     *     <li>{@link #jauCpv} copy pv-vector
17701     *     <li>{@link #jauPxp} vector product of two p-vectors
17702     *     <li>{@link #jauPpp} p-vector plus p-vector
17703     * </ul>
17704     *@version 2008 November 18
17705     *
17706     *  @since Release 20101201
17707     *
17708     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17709     */
17710     public static double[][] jauPvxpv(double a[][], double b[][] )
17711     {
17712        double wa[][] = new double[2][3], wb[][] = new double[2][3], axbd[] = new double[3], adxb[] = new double[3];
17713 
17714        double axb[][] = new double[2][3];
17715     /* Make copies of the inputs. */
17716        jauCpv(a, wa);
17717        jauCpv(b, wb);
17718 
17719     /* a x b = position part of result. */
17720        axb[0] = jauPxp(wa[0], wb[0]);
17721 
17722     /* a x bdot + adot x b = velocity part of result. */
17723        axbd = jauPxp(wa[0],wb[1]);
17724        adxb = jauPxp(wa[1],wb[0]);
17725        axb[1] = jauPpp(axbd, adxb);
17726 
17727        return axb;
17728 
17729         }
17730     
17731 
17732     /**
17733     *  p-vector outer (=vector=cross) product.
17734     *
17735     *<p>This function is derived from the International Astronomical Union's
17736     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17737     *
17738     *<p>Status:  vector/matrix support function.
17739     *
17740     *<!-- Given: -->
17741     *     @param a         double[3]       first p-vector
17742     *     @param b         double[3]       second p-vector
17743     *
17744     *<!-- Returned: -->
17745     *     @return axb       double[3]        <u>returned</u> a x b
17746     *
17747     *  Note:
17748     *     It is permissible to re-use the same array for any of the
17749     *     arguments.
17750     *
17751     *@version 2008 November 18
17752     *
17753     *  @since Release 20101201
17754     *
17755     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17756     */
17757     public static double[] jauPxp(double a[] , double b[]  )
17758     {
17759        double xa, ya, za, xb, yb, zb;
17760        double axb[] = new double[3];
17761 
17762        xa = a[0];
17763        ya = a[1];
17764        za = a[2];
17765        xb = b[0];
17766        yb = b[1];
17767        zb = b[2];
17768        axb[0] = ya*zb - za*yb;
17769        axb[1] = za*xb - xa*zb;
17770        axb[2] = xa*yb - ya*xb;
17771 
17772        return axb;
17773 
17774         }
17775     
17776 
17777     /**
17778     *  Express an r-matrix as an r-vector.
17779     *
17780     *<p>This function is derived from the International Astronomical Union's
17781     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17782     *
17783     *<p>Status:  vector/matrix support function.
17784     *
17785     *<!-- Given: -->
17786     *     @param r         double[3][3]     rotation matrix
17787     *
17788     *<!-- Returned: -->
17789     *     @return w         double[3]         <u>returned</u> rotation vector (Note 1)
17790     *
17791     * <p>Notes:
17792     * <ol>
17793     *
17794     * <li> A rotation matrix describes a rotation through some angle about
17795     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17796     *     returned by this function has the same direction as the Euler axis,
17797     *     and its magnitude is the angle in radians.  (The magnitude and
17798     *     direction can be separated by means of the function jauPn.)
17799     *
17800     * <li> If r is null, so is the result.  If r is not a rotation matrix
17801     *     the result is undefined;  r must be proper (i.e. have a positive
17802     *     determinant) and real orthogonal (inverse = transpose).
17803     *
17804     * <li> The reference frame rotates clockwise as seen looking along
17805     *     the rotation vector from the origin.
17806     *</ol>
17807     *@version 2008 May 12
17808     *
17809     *  @since Release 20101201
17810     *
17811     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17812     */
17813     public static double[] jauRm2v(double r[][] )
17814     {
17815        double x, y, z, s2, c2, phi, f;
17816        double w[] = new double[3];
17817 
17818        x = r[1][2] - r[2][1];
17819        y = r[2][0] - r[0][2];
17820        z = r[0][1] - r[1][0];
17821        s2 = sqrt(x*x + y*y + z*z);
17822        if (s2 > 0) {
17823           c2 = r[0][0] + r[1][1] + r[2][2] - 1;
17824           phi = atan2(s2, c2);
17825           f =  phi / s2;
17826           w[0] = x * f;
17827           w[1] = y * f;
17828           w[2] = z * f;
17829        } else {
17830           w[0] = 0.0;
17831           w[1] = 0.0;
17832           w[2] = 0.0;
17833        }
17834 
17835        return w;
17836 
17837         }
17838     
17839 
17840     /**
17841     *  Form the r-matrix corresponding to a given r-vector.
17842     *
17843     *<p>This function is derived from the International Astronomical Union's
17844     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17845     *
17846     *<p>Status:  vector/matrix support function.
17847     *
17848     *<!-- Given: -->
17849     *     @param w         double[3]       rotation vector (Note 1)
17850     *
17851     *<!-- Returned: -->
17852     *     @return r         double[3][3]      <u>returned</u> rotation matrix
17853     *
17854     * <p>Notes:
17855     * <ol>
17856     *
17857     * <li> A rotation matrix describes a rotation through some angle about
17858     *     some arbitrary axis called the Euler axis.  The "rotation vector"
17859     *     supplied to This function has the same direction as the Euler
17860     *     axis, and its magnitude is the angle in radians.
17861     *
17862     * <li> If w is null, the unit matrix is returned.
17863     *
17864     * <li> The reference frame rotates clockwise as seen looking along the
17865     *     rotation vector from the origin.
17866     *</ol>
17867     *@version 2008 May 11
17868     *
17869     *  @since Release 20101201
17870     *
17871     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17872     */
17873     public static double[][] jauRv2m(double w[])
17874     {
17875        double x, y, z, phi, s, c, f;
17876        double r[][] = new double[3][3];
17877 
17878 
17879     /* Euler angle (magnitude of rotation vector) and functions. */
17880        x = w[0];
17881        y = w[1];
17882        z = w[2];
17883        phi = sqrt(x*x + y*y + z*z);
17884        s = sin(phi);
17885        c = cos(phi);
17886        f = 1.0 - c;
17887 
17888     /* Euler axis (direction of rotation vector), perhaps null. */
17889        if (phi > 0.0) {
17890            x /= phi;
17891            y /= phi;
17892            z /= phi;
17893        }
17894 
17895     /* Form the rotation matrix. */
17896        r[0][0] = x*x*f + c;
17897        r[0][1] = x*y*f + z*s;
17898        r[0][2] = x*z*f - y*s;
17899        r[1][0] = y*x*f - z*s;
17900        r[1][1] = y*y*f + c;
17901        r[1][2] = y*z*f + x*s;
17902        r[2][0] = z*x*f + y*s;
17903        r[2][1] = z*y*f - x*s;
17904        r[2][2] = z*z*f + c;
17905 
17906        return r;
17907 
17908         }
17909     
17910 
17911     /**
17912     *  Rotate an r-matrix about the x-axis.
17913     *
17914     *<p>This function is derived from the International Astronomical Union's
17915     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17916     *
17917     *<p>Status:  vector/matrix support function.
17918     *
17919     *<!-- Given: -->
17920     *     @param phi     double           angle (radians)
17921     *
17922     *  Given and returned:
17923     *      @param r      double[3][3]    r-matrix <u>given and returned</u>
17924     *
17925     *  Sign convention:  The matrix can be used to rotate the reference
17926     *  frame of a vector.  Calling this function with positive phi
17927     *  incorporates in the matrix an additional rotation, about the x-axis,
17928     *  anticlockwise as seen looking towards the origin from positive x.
17929     *
17930     *<p>Called:<ul>
17931     *     <li>{@link #jauIr} initialize r-matrix to identity
17932     *     <li>{@link #jauRxr} product of two r-matrices
17933     *     <li>{@link #jauCr} copy r-matrix
17934     * </ul>
17935     *@version 2008 May 22
17936     *
17937     *  @since Release 20101201
17938     *
17939     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17940     */
17941     public static void jauRx(double phi, double r[][])
17942     {
17943        double s, c, a[][] = new double[3][3], w[][];
17944 
17945 
17946     /* Matrix representing new rotation. */
17947        s = sin(phi);
17948        c = cos(phi);
17949        jauIr(a);
17950        a[1][1] =  c;
17951        a[2][1] = -s;
17952        a[1][2] =  s;
17953        a[2][2] =  c;
17954 
17955     /* Rotate. */
17956        w = jauRxr(a, r);
17957 
17958     /* Return result. */
17959        jauCr(w, r);
17960 
17961        return;
17962 
17963         }
17964     
17965 
17966     /**
17967     *  Multiply a p-vector by an r-matrix.
17968     *
17969     *<p>This function is derived from the International Astronomical Union's
17970     *  SOFA (Standards Of Fundamental Astronomy) software collection.
17971     *
17972     *<p>Status:  vector/matrix support function.
17973     *
17974     *<!-- Given: -->
17975     *     @param r         double[3][3]     r-matrix
17976     *     @param p         double[3]        p-vector
17977     *
17978     *<!-- Returned: -->
17979     *     @return rp        double[3]         <u>returned</u> r * p
17980     *
17981     *  Note:
17982     *     It is permissible for p and rp to be the same array.
17983     *
17984     *<p>Called:<ul>
17985     *     <li>{@link #jauCp} copy p-vector
17986     * </ul>
17987     *@version 2008 October 28
17988     *
17989     *  @since Release 20101201
17990     *
17991     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
17992     */
17993     public static double[] jauRxp(double r[][], double p[])
17994     {
17995        double w, wrp[] = new double[3] ;
17996        int i, j;
17997 
17998 
17999     /* Matrix r * vector p. */
18000        for (j = 0; j < 3; j++) {
18001            w = 0.0;
18002            for (i = 0; i < 3; i++) {
18003                w += r[j][i] * p[i];
18004            }
18005            wrp[j] = w;
18006        }
18007 
18008 
18009        return wrp;
18010 
18011         }
18012     
18013 
18014     /**
18015     *  Multiply a pv-vector by an r-matrix.
18016     *
18017     *<p>This function is derived from the International Astronomical Union's
18018     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18019     *
18020     *<p>Status:  vector/matrix support function.
18021     *
18022     *<!-- Given: -->
18023     *     @param r         double[3][3]     r-matrix
18024     *     @param pv        double[2][3]     pv-vector
18025     *
18026     *<!-- Returned: -->
18027     *     @return rpv       double[2][3]      <u>returned</u> r * pv
18028     *
18029     *  Note:
18030     *     It is permissible for pv and rpv to be the same array.
18031     *
18032     *<p>Called:<ul>
18033     *     <li>{@link #jauRxp} product of r-matrix and p-vector
18034     * </ul>
18035     *@version 2008 October 28
18036     *
18037     *  @since Release 20101201
18038     *
18039     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18040     */
18041     public static double[][] jauRxpv(double r[][], double pv[][])
18042     {
18043        double rpv[][] = new double[2][0];
18044        rpv[0] = jauRxp(r, pv[0]);
18045        rpv[1] = jauRxp(r, pv[1]);
18046 
18047        return rpv;
18048 
18049         }
18050     
18051 
18052     /**
18053     *  Multiply two r-matrices.
18054     *
18055     *<p>This function is derived from the International Astronomical Union's
18056     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18057     *
18058     *<p>Status:  vector/matrix support function.
18059     *
18060     *<!-- Given: -->
18061     *     @param a         double[3][3]     first r-matrix
18062     *     @param b         double[3][3]     second r-matrix
18063     *
18064     *<!-- Returned: -->
18065     *     @return atb       double[3][3]      <u>returned</u> a * b
18066     *
18067     *  Note:
18068     *     It is permissible to re-use the same array for any of the
18069     *     arguments.
18070     *
18071     *<p>Called:<ul>
18072     *     <li>{@link #jauCr} copy r-matrix
18073     * </ul>
18074     *@version 2008 November 18
18075     *
18076     *  @since Release 20101201
18077     *
18078     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18079     */
18080     public static double[][] jauRxr(double a[][], double b[][])
18081     {
18082        int i, j, k;
18083        double w, wm[][] = new double[3][3];
18084 
18085 
18086        for (i = 0; i < 3; i++) {
18087           for (j = 0; j < 3; j++) {
18088              w = 0.0;
18089              for (k = 0; k < 3; k++) {
18090                 w +=  a[i][k] * b[k][j];
18091              }
18092              wm[i][j] = w;
18093           }
18094        }
18095 
18096        return wm;
18097 
18098      }
18099     
18100 
18101     /**
18102     *  Rotate an r-matrix about the y-axis.
18103     *
18104     *<p>This function is derived from the International Astronomical Union's
18105     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18106     *
18107     *<p>Status:  vector/matrix support function.
18108     *
18109     *<!-- Given: -->
18110     *     @param theta   double           angle (radians)
18111     *
18112     *  Given and returned:
18113     *     @param r      double[3][3]   <u>given &amp; returned</u> r-matrix
18114     *
18115     *  Sign convention:  The matrix can be used to rotate the reference
18116     *  frame of a vector.  Calling This function with positive theta
18117     *  incorporates in the matrix an additional rotation, about the y-axis,
18118     *  anticlockwise as seen looking towards the origin from positive y.
18119     *
18120     *<p>Called:<ul>
18121     *     <li>{@link #jauIr} initialize r-matrix to identity
18122     *     <li>{@link #jauRxr} product of two r-matrices
18123     *     <li>{@link #jauCr} copy r-matrix
18124     * </ul>
18125     *@version 2008 May 22
18126     *
18127     *  @since Release 20101201
18128     *
18129     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18130     */
18131     public static void jauRy(double theta, double r[][])
18132     {
18133        double s, c, a[][] = new double[3][3], w[][];
18134 
18135 
18136     /* Matrix representing new rotation. */
18137        s = sin(theta);
18138        c = cos(theta);
18139        jauIr(a);
18140        a[0][0] =  c;
18141        a[2][0] =  s;
18142        a[0][2] = -s;
18143        a[2][2] =  c;
18144 
18145     /* Rotate. */
18146        w = jauRxr(a, r);
18147 
18148     /* Return result. */
18149        jauCr(w, r);
18150 
18151        return;
18152 
18153         }
18154     
18155 
18156     /**
18157     *  Rotate an r-matrix about the z-axis.
18158     *
18159     *<p>This function is derived from the International Astronomical Union's
18160     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18161     *
18162     *<p>Status:  vector/matrix support function.
18163     *
18164     *<!-- Given: -->
18165     *     @param psi     double           angle (radians)
18166     *
18167     *  Given and returned:
18168     *     @param r      double[3][3]    <u>given &amp; retuned</u>r-matrix, rotated
18169     *
18170     *  Sign convention:  The matrix can be used to rotate the reference
18171     *  frame of a vector.  Calling This function with positive psi
18172     *  incorporates in the matrix an additional rotation, about the z-axis,
18173     *  anticlockwise as seen looking towards the origin from positive z.
18174     *
18175     *<p>Called:<ul>
18176     *     <li>{@link #jauIr} initialize r-matrix to identity
18177     *     <li>{@link #jauRxr} product of two r-matrices
18178     *     <li>{@link #jauCr} copy r-matrix
18179     * </ul>
18180     *@version 2008 May 22
18181     *
18182     *  @since Release 20101201
18183     *
18184     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18185     */
18186     public static void jauRz(double psi, double r[][])
18187     {
18188        double s, c, a[][] = new double[3][3], w[][];
18189 
18190 
18191     /* Matrix representing new rotation. */
18192        s = sin(psi);
18193        c = cos(psi);
18194        jauIr(a);
18195        a[0][0] =  c;
18196        a[1][0] = -s;
18197        a[0][1] =  s;
18198        a[1][1] =  c;
18199 
18200     /* Rotate. */
18201        w = jauRxr(a, r);
18202 
18203     /* Return result. */
18204        jauCr(w, r);
18205 
18206        return;
18207 
18208         }
18209     
18210 
18211     /**
18212     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18213     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18214     *  coordinates.  Compatible with IAU 2000A precession-nutation.
18215     *
18216     *<p>This function is derived from the International Astronomical Union's
18217     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18218     *
18219     *<p>Status:  canonical model.
18220     *
18221     *<!-- Given: -->
18222     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18223     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18224     *     @param x double     CIP coordinates (Note 3)
18225     *     @param y double     CIP coordinates (Note 3) 
18226     *
18227     * <!-- Returned (function value): -->
18228     *  @return double    the CIO locator s in radians (Note 2)
18229     *
18230     * <p>Notes:
18231     * <ol>
18232     *
18233     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18234     *     convenient way between the two arguments.  For example,
18235     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18236     *     among others:
18237     *<pre>
18238     *            date1          date2
18239     *
18240     *         2450123.7           0.0       (JD method)
18241     *         2451545.0       -1421.3       (J2000 method)
18242     *         2400000.5       50123.2       (MJD method)
18243     *         2450123.5           0.2       (date &amp; time method)
18244     *</pre>
18245     *     The JD method is the most natural and convenient to use in
18246     *     cases where the loss of several decimal digits of resolution
18247     *     is acceptable.  The J2000 method is best matched to the way
18248     *     the argument is handled internally and will deliver the
18249     *     optimum resolution.  The MJD method and the date &amp; time methods
18250     *     are both good compromises between resolution and convenience.
18251     *
18252     * <li> The CIO locator s is the difference between the right ascensions
18253     *     of the same point in two systems:  the two systems are the GCRS
18254     *     and the CIP,CIO, and the point is the ascending node of the
18255     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18256     *     throughout 1900-2100.
18257     *
18258     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18259     *     are the x and y components of the CIP unit vector;  this series
18260     *     is more compact than a direct series for s would be.  This
18261     *     function requires X,Y to be supplied by the caller, who is
18262     *     responsible for providing values that are consistent with the
18263     *     supplied date.
18264     *
18265     * <li> The model is consistent with the IAU 2000A precession-nutation.
18266     *</ol>
18267     *<p>Called:<ul>
18268     *     <li>{@link #jauFal03} mean anomaly of the Moon
18269     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18270     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18271     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18272     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18273     *     <li>{@link #jauFave03} mean longitude of Venus
18274     *     <li>{@link #jauFae03} mean longitude of Earth
18275     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18276     * </ul>
18277     *<p>References:
18278     *
18279     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18280     *     "Expressions for the Celestial Intermediate Pole and Celestial
18281     *     Ephemeris Origin consistent with the IAU 2000A precession-
18282     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18283     *
18284     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18285     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18286     *
18287     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18288     *     IERS Technical Note No. 32, BKG (2004)
18289     *
18290     *@version 2010 January 18
18291     *
18292     *  @since Release 20101201
18293     *
18294     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18295     */
18296     public static double jauS00(double date1, double date2, double x, double y)
18297     {
18298     /* Time since J2000.0, in Julian centuries */
18299        double t;
18300 
18301     /* Miscellaneous */
18302        int i, j;
18303        double a, w0, w1, w2, w3, w4, w5;
18304 
18305     /* Fundamental arguments */
18306        double fa[] = new double[8];
18307 
18308     /* Returned value */
18309        double s;
18310 
18311     /* --------------------- */
18312     /* The series for s+XY/2 */
18313     /* --------------------- */
18314 
18315     /* Polynomial coefficients */
18316        final double sp[] = {
18317 
18318        /* 1-6 */
18319               94.00e-6,
18320             3808.35e-6,
18321             -119.94e-6,
18322           -72574.09e-6,
18323               27.70e-6,
18324               15.61e-6
18325        };
18326 
18327     /* Terms of order t^0 */
18328        final TERM s0[] = {
18329 
18330        /* 1-10 */
18331           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18332           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18333           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18334           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18335           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18336           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18337           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18338           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18339           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18340           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18341 
18342        /* 11-20 */
18343           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18344           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18345           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18346           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18347           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18348           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18349           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18350           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18351           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18352           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18353 
18354        /* 21-30 */
18355           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18356           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18357           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18358           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18359           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18360           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18361           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18362           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18363           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18364           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18365 
18366        /* 31-33 */
18367           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18368           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18369           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18370        };
18371 
18372     /* Terms of order t^1 */
18373        final TERM s1[] ={
18374 
18375        /* 1-3 */
18376           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18377           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.71e-6,  -0.03e-6 ),
18378           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18379        };
18380 
18381     /* Terms of order t^2 */
18382        final TERM s2[] ={
18383 
18384        /* 1-10 */
18385           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.53e-6,  -0.17e-6 ),
18386           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18387           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18388           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18389           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18390           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18391           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18392           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18393           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18394           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18395 
18396        /* 11-20 */
18397           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18398           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18399           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18400           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18401           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18402           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18403           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
18404           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
18405           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
18406           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
18407 
18408        /* 21-25 */
18409           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
18410           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
18411           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18412           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
18413           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18414        };
18415 
18416     /* Terms of order t^3 */
18417        final TERM s3[] ={
18418 
18419        /* 1-4 */
18420           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.51e-6 ),
18421           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.39e-6 ),
18422           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.24e-6 ),
18423           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.22e-6 )
18424        };
18425 
18426     /* Terms of order t^4 */
18427        final TERM s4[] ={
18428 
18429        /* 1-1 */
18430           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
18431        };
18432 
18433     /* Number of terms in the series */
18434        final int NS0 = s0.length;
18435        final int NS1 = s1.length;
18436        final int NS2 = s2.length;
18437        final int NS3 = s3.length;
18438        final int NS4 = s4.length;
18439 
18440     /*--------------------------------------------------------------------*/
18441 
18442     /* Interval between fundamental epoch J2000.0 and current date (JC). */
18443        t = ((date1 - DJ00) + date2) / DJC;
18444 
18445     /* Fundamental Arguments (from IERS Conventions 2003) */
18446 
18447     /* Mean anomaly of the Moon. */
18448        fa[0] = jauFal03(t);
18449 
18450     /* Mean anomaly of the Sun. */
18451        fa[1] = jauFalp03(t);
18452 
18453     /* Mean longitude of the Moon minus that of the ascending node. */
18454        fa[2] = jauFaf03(t);
18455 
18456     /* Mean elongation of the Moon from the Sun. */
18457        fa[3] = jauFad03(t);
18458 
18459     /* Mean longitude of the ascending node of the Moon. */
18460        fa[4] = jauFaom03(t);
18461 
18462     /* Mean longitude of Venus. */
18463        fa[5] = jauFave03(t);
18464 
18465     /* Mean longitude of Earth. */
18466        fa[6] = jauFae03(t);
18467 
18468     /* General precession in longitude. */
18469        fa[7] = jauFapa03(t);
18470 
18471     /* Evaluate s. */
18472        w0 = sp[0];
18473        w1 = sp[1];
18474        w2 = sp[2];
18475        w3 = sp[3];
18476        w4 = sp[4];
18477        w5 = sp[5];
18478 
18479        for (i = NS0-1; i >= 0; i--) {
18480        a = 0.0;
18481        for (j = 0; j < 8; j++) {
18482            a += (double)s0[i].nfa[j] * fa[j];
18483        }
18484        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
18485        }
18486 
18487        for (i = NS1-1; i >= 0; i--) {
18488        a = 0.0;
18489        for (j = 0; j < 8; j++) {
18490            a += (double)s1[i].nfa[j] * fa[j];
18491        }
18492        w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
18493        }
18494 
18495        for (i = NS2-1; i >= 0; i--) {
18496        a = 0.0;
18497        for (j = 0; j < 8; j++) {
18498            a += (double)s2[i].nfa[j] * fa[j];
18499        }
18500        w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
18501        }
18502 
18503        for (i = NS3-1; i >= 0; i--) {
18504        a = 0.0;
18505        for (j = 0; j < 8; j++) {
18506            a += (double)s3[i].nfa[j] * fa[j];
18507        }
18508        w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
18509        }
18510 
18511        for (i = NS4-1; i >= 0; i--) {
18512        a = 0.0;
18513        for (j = 0; j < 8; j++) {
18514            a += (double)s4[i].nfa[j] * fa[j];
18515        }
18516        w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
18517        }
18518 
18519        s = (w0 +
18520            (w1 +
18521            (w2 +
18522            (w3 +
18523            (w4 +
18524             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
18525 
18526        return s;
18527 
18528         }
18529     
18530 
18531     /**
18532     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18533     *  the equator of the Celestial Intermediate Pole, using the IAU 2000A
18534     *  precession-nutation model.
18535     *
18536     *<p>This function is derived from the International Astronomical Union's
18537     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18538     *
18539     *<p>Status:  support function.
18540     *
18541     *<!-- Given: -->
18542     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18543     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18544     *
18545     * <!-- Returned (function value): -->
18546     *  @return double    the CIO locator s in radians (Note 2)
18547     *
18548     * <p>Notes:
18549     * <ol>
18550     *
18551     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18552     *     convenient way between the two arguments.  For example,
18553     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18554     *     among others:
18555     *<pre>
18556     *            date1          date2
18557     *
18558     *         2450123.7           0.0       (JD method)
18559     *         2451545.0       -1421.3       (J2000 method)
18560     *         2400000.5       50123.2       (MJD method)
18561     *         2450123.5           0.2       (date &amp; time method)
18562     *</pre>
18563     *     The JD method is the most natural and convenient to use in
18564     *     cases where the loss of several decimal digits of resolution
18565     *     is acceptable.  The J2000 method is best matched to the way
18566     *     the argument is handled internally and will deliver the
18567     *     optimum resolution.  The MJD method and the date &amp; time methods
18568     *     are both good compromises between resolution and convenience.
18569     *
18570     * <li> The CIO locator s is the difference between the right ascensions
18571     *     of the same point in two systems.  The two systems are the GCRS
18572     *     and the CIP,CIO, and the point is the ascending node of the
18573     *     CIP equator.  The CIO locator s remains a small fraction of
18574     *     1 arcsecond throughout 1900-2100.
18575     *
18576     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18577     *     are the x and y components of the CIP unit vector;  this series
18578     *     is more compact than a direct series for s would be.  The present
18579     *     function uses the full IAU 2000A nutation model when predicting
18580     *     the CIP position.  Faster results, with no significant loss of
18581     *     accuracy, can be obtained via the function jauS00b, which uses
18582     *     instead the IAU 2000B truncated model.
18583     *</ol>
18584     *<p>Called:<ul>
18585     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
18586     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18587     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18588     * </ul>
18589     *<p>References:
18590     *
18591     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18592     *     "Expressions for the Celestial Intermediate Pole and Celestial
18593     *     Ephemeris Origin consistent with the IAU 2000A precession-
18594     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18595     *
18596     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18597     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18598     *
18599     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18600     *     IERS Technical Note No. 32, BKG (2004)
18601     *
18602     *@version 2010 January 18
18603     *
18604     *  @since Release 20101201
18605     *
18606     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18607     */
18608     public static double jauS00a(double date1, double date2)
18609     {
18610        double s;
18611 
18612 
18613     /* Bias-precession-nutation-matrix, IAU 2000A. */
18614        double rbpn[][] = jauPnm00a(date1, date2);
18615 
18616     /* Extract the CIP coordinates. */
18617        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18618 
18619     /* Compute the CIO locator s, given the CIP coordinates. */
18620        s = jauS00(date1, date2, cip.x, cip.y);
18621 
18622        return s;
18623 
18624         }
18625     
18626 
18627     /**
18628     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18629     *  the equator of the Celestial Intermediate Pole, using the IAU 2000B
18630     *  precession-nutation model.
18631     *
18632     *<p>This function is derived from the International Astronomical Union's
18633     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18634     *
18635     *<p>Status:  support function.
18636     *
18637     *<!-- Given: -->
18638     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18639     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18640     *
18641     * <!-- Returned (function value): -->
18642     *  @return double    the CIO locator s in radians (Note 2)
18643     *
18644     * <p>Notes:
18645     * <ol>
18646     *
18647     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18648     *     convenient way between the two arguments.  For example,
18649     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18650     *     among others:
18651     *<pre>
18652     *            date1          date2
18653     *
18654     *         2450123.7           0.0       (JD method)
18655     *         2451545.0       -1421.3       (J2000 method)
18656     *         2400000.5       50123.2       (MJD method)
18657     *         2450123.5           0.2       (date &amp; time method)
18658     *</pre>
18659     *     The JD method is the most natural and convenient to use in
18660     *     cases where the loss of several decimal digits of resolution
18661     *     is acceptable.  The J2000 method is best matched to the way
18662     *     the argument is handled internally and will deliver the
18663     *     optimum resolution.  The MJD method and the date &amp; time methods
18664     *     are both good compromises between resolution and convenience.
18665     *
18666     * <li> The CIO locator s is the difference between the right ascensions
18667     *     of the same point in two systems.  The two systems are the GCRS
18668     *     and the CIP,CIO, and the point is the ascending node of the
18669     *     CIP equator.  The CIO locator s remains a small fraction of
18670     *     1 arcsecond throughout 1900-2100.
18671     *
18672     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18673     *     are the x and y components of the CIP unit vector;  this series
18674     *     is more compact than a direct series for s would be.  The present
18675     *     function uses the IAU 2000B truncated nutation model when
18676     *     predicting the CIP position.  The function jauS00a uses instead
18677     *     the full IAU 2000A model, but with no significant increase in
18678     *     accuracy and at some cost in speed.
18679     *</ol>
18680     *<p>Called:<ul>
18681     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
18682     *     <li>{@link #jauBpn2xy} extract CIP X,Y from the BPN matrix
18683     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
18684     * </ul>
18685     *<p>References:
18686     *
18687     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
18688     *     "Expressions for the Celestial Intermediate Pole and Celestial
18689     *     Ephemeris Origin consistent with the IAU 2000A precession-
18690     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
18691     *
18692     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
18693     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
18694     *
18695     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
18696     *     IERS Technical Note No. 32, BKG (2004)
18697     *
18698     *@version 2010 January 18
18699     *
18700     *  @since Release 20101201
18701     *
18702     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18703     */
18704     public static double jauS00b(double date1, double date2)
18705     {
18706        double rbpn[][] = new double[3][3], s;
18707 
18708 
18709     /* Bias-precession-nutation-matrix, IAU 2000B. */
18710        rbpn = jauPnm00b(date1, date2);
18711 
18712     /* Extract the CIP coordinates. */
18713        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
18714 
18715     /* Compute the CIO locator s, given the CIP coordinates. */
18716        s = jauS00(date1, date2, cip.x, cip.y);
18717 
18718        return s;
18719 
18720         }
18721     
18722 
18723     /**
18724     *  The CIO locator s, positioning the Celestial Intermediate Origin on
18725     *  the equator of the Celestial Intermediate Pole, given the CIP's X,Y
18726     *  coordinates.  Compatible with IAU 2006/2000A precession-nutation.
18727     *
18728     *<p>This function is derived from the International Astronomical Union's
18729     *  SOFA (Standards Of Fundamental Astronomy) software collection.
18730     *
18731     *<p>Status:  canonical model.
18732     *
18733     *<!-- Given: -->
18734     *     @param date1 double TT as a 2-part Julian Date (Note 1)
18735     *     @param date2 double TT as a 2-part Julian Date (Note 1)
18736     *     @param x double     CIP coordinates (Note 3)
18737     *     @param y double     CIP coordinates (Note 3) 
18738     *
18739     * <!-- Returned (function value): -->
18740     *  @return double    the CIO locator s in radians (Note 2)
18741     *
18742     * <p>Notes:
18743     * <ol>
18744     *
18745     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
18746     *     convenient way between the two arguments.  For example,
18747     *     JD(TT)=2450123.7 could be expressed in any of these ways,
18748     *     among others:
18749     *<pre>
18750     *            date1          date2
18751     *
18752     *         2450123.7           0.0       (JD method)
18753     *         2451545.0       -1421.3       (J2000 method)
18754     *         2400000.5       50123.2       (MJD method)
18755     *         2450123.5           0.2       (date &amp; time method)
18756     *</pre>
18757     *     The JD method is the most natural and convenient to use in
18758     *     cases where the loss of several decimal digits of resolution
18759     *     is acceptable.  The J2000 method is best matched to the way
18760     *     the argument is handled internally and will deliver the
18761     *     optimum resolution.  The MJD method and the date &amp; time methods
18762     *     are both good compromises between resolution and convenience.
18763     *
18764     * <li> The CIO locator s is the difference between the right ascensions
18765     *     of the same point in two systems:  the two systems are the GCRS
18766     *     and the CIP,CIO, and the point is the ascending node of the
18767     *     CIP equator.  The quantity s remains below 0.1 arcsecond
18768     *     throughout 1900-2100.
18769     *
18770     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
18771     *     are the x and y components of the CIP unit vector;  this series
18772     *     is more compact than a direct series for s would be.  This
18773     *     function requires X,Y to be supplied by the caller, who is
18774     *     responsible for providing values that are consistent with the
18775     *     supplied date.
18776     *
18777     * <li> The model is consistent with the "P03" precession (Capitaine et
18778     *     al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the
18779     *     IAU 2000A nutation (with P03 adjustments).
18780     *</ol>
18781     *<p>Called:<ul>
18782     *     <li>{@link #jauFal03} mean anomaly of the Moon
18783     *     <li>{@link #jauFalp03} mean anomaly of the Sun
18784     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
18785     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
18786     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
18787     *     <li>{@link #jauFave03} mean longitude of Venus
18788     *     <li>{@link #jauFae03} mean longitude of Earth
18789     *     <li>{@link #jauFapa03} general accumulated precession in longitude
18790     * </ul>
18791     *<p>References:
18792     *
18793     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003, Astron.
18794     *     Astrophys. 432, 355
18795     *
18796     *     <p>McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003),
18797     *     IERS Technical Note No. 32, BKG
18798     *
18799     *@version 2009 December 17
18800     *
18801     *  @since Release 20101201
18802     *
18803     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
18804     */
18805     public static double jauS06(double date1, double date2, double x, double y)
18806     {
18807     /* Time since J2000.0, in Julian centuries */
18808        double t;
18809 
18810     /* Miscellaneous */
18811        int i, j;
18812        double a, w0, w1, w2, w3, w4, w5;
18813 
18814     /* Fundamental arguments */
18815        double fa[] = new double[8];
18816 
18817     /* Returned value */
18818        double s;
18819 
18820     /* --------------------- */
18821     /* The series for s+XY/2 */
18822     /* --------------------- */
18823 
18824     /* Polynomial coefficients */
18825        final double sp[] = {
18826 
18827        /* 1-6 */
18828               94.00e-6,
18829             3808.65e-6,
18830             -122.68e-6,
18831           -72574.11e-6,
18832               27.98e-6,
18833               15.62e-6
18834        };
18835 
18836     /* Terms of order t^0 */
18837        final TERM s0[] = {
18838 
18839        /* 1-10 */
18840           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0}, -2640.73e-6,   0.39e-6 ),
18841           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},   -63.53e-6,   0.02e-6 ),
18842           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},   -11.75e-6,  -0.01e-6 ),
18843           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},   -11.21e-6,  -0.01e-6 ),
18844           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},     4.57e-6,   0.00e-6 ),
18845           new TERM(new int[]{ 0,  0,  2,  0,  3,  0,  0,  0},    -2.02e-6,   0.00e-6 ),
18846           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},    -1.98e-6,   0.00e-6 ),
18847           new TERM(new int[]{ 0,  0,  0,  0,  3,  0,  0,  0},     1.72e-6,   0.00e-6 ),
18848           new TERM(new int[]{ 0,  1,  0,  0,  1,  0,  0,  0},     1.41e-6,   0.01e-6 ),
18849           new TERM(new int[]{ 0,  1,  0,  0, -1,  0,  0,  0},     1.26e-6,   0.01e-6 ),
18850 
18851        /* 11-20 */
18852           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18853           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},     0.63e-6,   0.00e-6 ),
18854           new TERM(new int[]{ 0,  1,  2, -2,  3,  0,  0,  0},    -0.46e-6,   0.00e-6 ),
18855           new TERM(new int[]{ 0,  1,  2, -2,  1,  0,  0,  0},    -0.45e-6,   0.00e-6 ),
18856           new TERM(new int[]{ 0,  0,  4, -4,  4,  0,  0,  0},    -0.36e-6,   0.00e-6 ),
18857           new TERM(new int[]{ 0,  0,  1, -1,  1, -8, 12,  0},     0.24e-6,   0.12e-6 ),
18858           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.32e-6,   0.00e-6 ),
18859           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.28e-6,   0.00e-6 ),
18860           new TERM(new int[]{ 1,  0,  2,  0,  3,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18861           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18862 
18863        /* 21-30 */
18864           new TERM(new int[]{ 0,  0,  2, -2,  0,  0,  0,  0},     0.21e-6,   0.00e-6 ),
18865           new TERM(new int[]{ 0,  1, -2,  2, -3,  0,  0,  0},    -0.19e-6,   0.00e-6 ),
18866           new TERM(new int[]{ 0,  1, -2,  2, -1,  0,  0,  0},    -0.18e-6,   0.00e-6 ),
18867           new TERM(new int[]{ 0,  0,  0,  0,  0,  8,-13, -1},     0.10e-6,  -0.05e-6 ),
18868           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.15e-6,   0.00e-6 ),
18869           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18870           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     0.14e-6,   0.00e-6 ),
18871           new TERM(new int[]{ 1,  0,  0, -2,  1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18872           new TERM(new int[]{ 1,  0,  0, -2, -1,  0,  0,  0},    -0.14e-6,   0.00e-6 ),
18873           new TERM(new int[]{ 0,  0,  4, -2,  4,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18874 
18875        /* 31-33 */
18876           new TERM(new int[]{ 0,  0,  2, -2,  4,  0,  0,  0},     0.11e-6,   0.00e-6 ),
18877           new TERM(new int[]{ 1,  0, -2,  0, -3,  0,  0,  0},    -0.11e-6,   0.00e-6 ),
18878           new TERM(new int[]{ 1,  0, -2,  0, -1,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18879        };
18880 
18881     /* Terms of order t^1 */
18882        final TERM s1[] = {
18883 
18884        /* 1 - 3 */
18885           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -0.07e-6,   3.57e-6 ),
18886           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     1.73e-6,  -0.03e-6 ),
18887           new TERM(new int[]{ 0,  0,  2, -2,  3,  0,  0,  0},     0.00e-6,   0.48e-6 )
18888        };
18889 
18890     /* Terms of order t^2 */
18891        final TERM s2[] = {
18892 
18893        /* 1-10 */
18894           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},   743.52e-6,  -0.17e-6 ),
18895           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    56.91e-6,   0.06e-6 ),
18896           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},     9.84e-6,  -0.01e-6 ),
18897           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},    -8.85e-6,   0.01e-6 ),
18898           new TERM(new int[]{ 0,  1,  0,  0,  0,  0,  0,  0},    -6.38e-6,  -0.05e-6 ),
18899           new TERM(new int[]{ 1,  0,  0,  0,  0,  0,  0,  0},    -3.07e-6,   0.00e-6 ),
18900           new TERM(new int[]{ 0,  1,  2, -2,  2,  0,  0,  0},     2.23e-6,   0.00e-6 ),
18901           new TERM(new int[]{ 0,  0,  2,  0,  1,  0,  0,  0},     1.67e-6,   0.00e-6 ),
18902           new TERM(new int[]{ 1,  0,  2,  0,  2,  0,  0,  0},     1.30e-6,   0.00e-6 ),
18903           new TERM(new int[]{ 0,  1, -2,  2, -2,  0,  0,  0},     0.93e-6,   0.00e-6 ),
18904 
18905        /* 11-20 */
18906           new TERM(new int[]{ 1,  0,  0, -2,  0,  0,  0,  0},     0.68e-6,   0.00e-6 ),
18907           new TERM(new int[]{ 0,  0,  2, -2,  1,  0,  0,  0},    -0.55e-6,   0.00e-6 ),
18908           new TERM(new int[]{ 1,  0, -2,  0, -2,  0,  0,  0},     0.53e-6,   0.00e-6 ),
18909           new TERM(new int[]{ 0,  0,  0,  2,  0,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18910           new TERM(new int[]{ 1,  0,  0,  0,  1,  0,  0,  0},    -0.27e-6,   0.00e-6 ),
18911           new TERM(new int[]{ 1,  0, -2, -2, -2,  0,  0,  0},    -0.26e-6,   0.00e-6 ),
18912           new TERM(new int[]{ 1,  0,  0,  0, -1,  0,  0,  0},    -0.25e-6,   0.00e-6 ),
18913           new TERM(new int[]{ 1,  0,  2,  0,  1,  0,  0,  0},     0.22e-6,   0.00e-6 ),
18914           new TERM(new int[]{ 2,  0,  0, -2,  0,  0,  0,  0},    -0.21e-6,   0.00e-6 ),
18915           new TERM(new int[]{ 2,  0, -2,  0, -1,  0,  0,  0},     0.20e-6,   0.00e-6 ),
18916 
18917        /* 21-25 */
18918           new TERM(new int[]{ 0,  0,  2,  2,  2,  0,  0,  0},     0.17e-6,   0.00e-6 ),
18919           new TERM(new int[]{ 2,  0,  2,  0,  2,  0,  0,  0},     0.13e-6,   0.00e-6 ),
18920           new TERM(new int[]{ 2,  0,  0,  0,  0,  0,  0,  0},    -0.13e-6,   0.00e-6 ),
18921           new TERM(new int[]{ 1,  0,  2, -2,  2,  0,  0,  0},    -0.12e-6,   0.00e-6 ),
18922           new TERM(new int[]{ 0,  0,  2,  0,  0,  0,  0,  0},    -0.11e-6,   0.00e-6 )
18923        };
18924 
18925     /* Terms of order t^3 */
18926        final TERM s3[] = {
18927 
18928        /* 1-4 */
18929           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},     0.30e-6, -23.42e-6 ),
18930           new TERM(new int[]{ 0,  0,  2, -2,  2,  0,  0,  0},    -0.03e-6,  -1.46e-6 ),
18931           new TERM(new int[]{ 0,  0,  2,  0,  2,  0,  0,  0},    -0.01e-6,  -0.25e-6 ),
18932           new TERM(new int[]{ 0,  0,  0,  0,  2,  0,  0,  0},     0.00e-6,   0.23e-6 )
18933        };
18934 
18935     /* Terms of order t^4 */
18936        final TERM s4[] = {
18937 
18938        /* 1-1 */
18939           new TERM(new int[]{ 0,  0,  0,  0,  1,  0,  0,  0},    -0.26e-6,  -0.01e-6 )
18940        };
18941 
18942     /* Number of terms in the series */
18943        final int NS0 = s0.length;
18944        final int NS1 = s1.length;
18945        final int NS2 = s2.length;
18946        final int NS3 = s3.length;
18947        final int NS4 = s4.length;
18948 
18949     /*--------------------------------------------------------------------*/
18950 
18951     /* Interval between fundamental epoch J2000.0 and current date (JC). */
18952        t = ((date1 - DJ00) + date2) / DJC;
18953 
18954     /* Fundamental Arguments (from IERS Conventions 2003) */
18955 
18956     /* Mean anomaly of the Moon. */
18957        fa[0] = jauFal03(t);
18958 
18959     /* Mean anomaly of the Sun. */
18960        fa[1] = jauFalp03(t);
18961 
18962     /* Mean longitude of the Moon minus that of the ascending node. */
18963        fa[2] = jauFaf03(t);
18964 
18965     /* Mean elongation of the Moon from the Sun. */
18966        fa[3] = jauFad03(t);
18967 
18968     /* Mean longitude of the ascending node of the Moon. */
18969        fa[4] = jauFaom03(t);
18970 
18971     /* Mean longitude of Venus. */
18972        fa[5] = jauFave03(t);
18973 
18974     /* Mean longitude of Earth. */
18975        fa[6] = jauFae03(t);
18976 
18977     /* General precession in longitude. */
18978        fa[7] = jauFapa03(t);
18979 
18980     /* Evaluate s. */
18981        w0 = sp[0];
18982        w1 = sp[1];
18983        w2 = sp[2];
18984        w3 = sp[3];
18985        w4 = sp[4];
18986        w5 = sp[5];
18987 
18988        for (i = NS0-1; i >= 0; i--) {
18989        a = 0.0;
18990        for (j = 0; j < 8; j++) {
18991           a += (double)s0[i].nfa[j] * fa[j];
18992        }
18993        w0 += s0[i].s * sin(a) + s0[i].c * cos(a);
18994        }
18995 
18996        for (i = NS1-1; i >= 0; i--) {
18997           a = 0.0;
18998           for (j = 0; j < 8; j++) {
18999              a += (double)s1[i].nfa[j] * fa[j];
19000           }
19001           w1 += s1[i].s * sin(a) + s1[i].c * cos(a);
19002        }
19003 
19004        for (i = NS2-1; i >= 0; i--) {
19005           a = 0.0;
19006           for (j = 0; j < 8; j++) {
19007              a += (double)s2[i].nfa[j] * fa[j];
19008           }
19009           w2 += s2[i].s * sin(a) + s2[i].c * cos(a);
19010        }
19011 
19012        for (i = NS3-1; i >= 0; i--) {
19013           a = 0.0;
19014           for (j = 0; j < 8; j++) {
19015              a += (double)s3[i].nfa[j] * fa[j];
19016           }
19017           w3 += s3[i].s * sin(a) + s3[i].c * cos(a);
19018        }
19019 
19020        for (i = NS4-1; i >= 0; i--) {
19021           a = 0.0;
19022           for (j = 0; j < 8; j++) {
19023              a += (double)s4[i].nfa[j] * fa[j];
19024           }
19025           w4 += s4[i].s * sin(a) + s4[i].c * cos(a);
19026        }
19027 
19028        s = (w0 +
19029            (w1 +
19030            (w2 +
19031            (w3 +
19032            (w4 +
19033             w5 * t) * t) * t) * t) * t) * DAS2R - x*y/2.0;
19034 
19035        return s;
19036 
19037         }
19038     
19039 
19040     /**
19041     *  The CIO locator s, positioning the Celestial Intermediate Origin on
19042     *  the equator of the Celestial Intermediate Pole, using the IAU 2006
19043     *  precession and IAU 2000A nutation models.
19044     *
19045     *<p>This function is derived from the International Astronomical Union's
19046     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19047     *
19048     *<p>Status:  support function.
19049     *
19050     *<!-- Given: -->
19051     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19052     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19053     *
19054     * <!-- Returned (function value): -->
19055     *  @return double    the CIO locator s in radians (Note 2)
19056     *
19057     * <p>Notes:
19058     * <ol>
19059     *
19060     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19061     *     convenient way between the two arguments.  For example,
19062     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19063     *     among others:
19064     *<pre>
19065     *            date1          date2
19066     *
19067     *         2450123.7           0.0       (JD method)
19068     *         2451545.0       -1421.3       (J2000 method)
19069     *         2400000.5       50123.2       (MJD method)
19070     *         2450123.5           0.2       (date &amp; time method)
19071     *</pre>
19072     *     The JD method is the most natural and convenient to use in
19073     *     cases where the loss of several decimal digits of resolution
19074     *     is acceptable.  The J2000 method is best matched to the way
19075     *     the argument is handled internally and will deliver the
19076     *     optimum resolution.  The MJD method and the date &amp; time methods
19077     *     are both good compromises between resolution and convenience.
19078     *
19079     * <li> The CIO locator s is the difference between the right ascensions
19080     *     of the same point in two systems.  The two systems are the GCRS
19081     *     and the CIP,CIO, and the point is the ascending node of the
19082     *     CIP equator.  The CIO locator s remains a small fraction of
19083     *     1 arcsecond throughout 1900-2100.
19084     *
19085     * <li> The series used to compute s is in fact for s+XY/2, where X and Y
19086     *     are the x and y components of the CIP unit vector;  this series is
19087     *     more compact than a direct series for s would be.  The present
19088     *     function uses the full IAU 2000A nutation model when predicting
19089     *     the CIP position.
19090     *</ol>
19091     *<p>Called:<ul>
19092     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
19093     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
19094     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
19095     * </ul>
19096     *<p>References:
19097     *
19098     *    <p>Capitaine, N., Chapront, J., Lambert, S. and Wallace, P.,
19099     *     "Expressions for the Celestial Intermediate Pole and Celestial
19100     *     Ephemeris Origin consistent with the IAU 2000A precession-
19101     *     nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
19102     *
19103     *     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
19104     *          intermediate origin" (CIO) by IAU 2006 Resolution 2.
19105     *
19106     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
19107     *
19108     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
19109     *     IERS Technical Note No. 32, BKG
19110     *
19111     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
19112     *
19113     *@version 2010 January 18
19114     *
19115     *  @since Release 20101201
19116     *
19117     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19118     */
19119     public static double jauS06a(double date1, double date2)
19120     {
19121        double rnpb[][] = new double[3][3], s;
19122 
19123 
19124     /* Bias-precession-nutation-matrix, IAU 20006/2000A. */
19125        rnpb = jauPnm06a(date1, date2);
19126 
19127     /* Extract the CIP coordinates. */
19128        CelestialIntermediatePole cip = jauBpn2xy(rnpb);
19129 
19130     /* Compute the CIO locator s, given the CIP coordinates. */
19131        s = jauS06(date1, date2, cip.x, cip.y);
19132 
19133        return s;
19134 
19135         }
19136     
19137 
19138     /**
19139     *  Convert spherical coordinates to Cartesian.
19140     *
19141     *<p>This function is derived from the International Astronomical Union's
19142     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19143     *
19144     *<p>Status:  vector/matrix support function.
19145     *
19146     *<!-- Given: -->
19147     *     @param theta     double        longitude angle (radians)
19148     *     @param phi       double        latitude angle (radians)
19149     *
19150     *<!-- Returned: -->
19151     *     @return c         double[3]      <u>returned</u> direction cosines
19152     *
19153     *@version 2008 October 28
19154     *
19155     *  @since Release 20101201
19156     *
19157     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19158     */
19159     public static double[] jauS2c(double theta, double phi )
19160     {
19161        double cp, c[] = new double[3];
19162 
19163 
19164        cp = cos(phi);
19165        c[0] = cos(theta) * cp;
19166        c[1] = sin(theta) * cp;
19167        c[2] = sin(phi);
19168 
19169        return c;
19170 
19171         }
19172     
19173 
19174     /**
19175     *  Convert spherical polar coordinates to p-vector.
19176     *
19177     *<p>This function is derived from the International Astronomical Union's
19178     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19179     *
19180     *<p>Status:  vector/matrix support function.
19181     *
19182     *<!-- Given: -->
19183     *     @param theta    double        longitude angle (radians)
19184     *     @param phi      double        latitude angle (radians)
19185     *     @param r        double        radial distance
19186     *
19187     *<!-- Returned: -->
19188     *     @return p        double[3]      <u>returned</u> Cartesian coordinates
19189     *
19190     *<p>Called:<ul>
19191     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19192     *     <li>{@link #jauSxp} multiply p-vector by scalar
19193     * </ul>
19194     *@version 2008 May 11
19195     *
19196     *  @since Release 20101201
19197     *
19198     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19199     */
19200     public static double[] jauS2p(double theta, double phi, double r )
19201     {
19202        double p[];
19203        double u[] = new double[3];
19204 
19205 
19206        u = jauS2c(theta,phi);
19207        p = jauSxp(r,u);
19208 
19209        return p;
19210 
19211         }
19212     
19213 
19214     /**
19215     *  Convert position/velocity from spherical to Cartesian coordinates.
19216     *
19217     *<p>This function is derived from the International Astronomical Union's
19218     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19219     *
19220     *<p>Status:  vector/matrix support function.
19221     *
19222     *<!-- Given: -->
19223     *     @param theta     double           longitude angle (radians)
19224     *     @param phi       double           latitude angle (radians)
19225     *     @param r         double           radial distance
19226     *     @param td        double           rate of change of theta
19227     *     @param pd        double           rate of change of phi
19228     *     @param rd        double           rate of change of r
19229     *
19230     *<!-- Returned: -->
19231     *     @return pv        double[2][3]      <u>returned</u> pv-vector
19232     *
19233     *@version 2008 May 25
19234     *
19235     *  @since Release 20101201
19236     *
19237     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19238     */
19239     public static double[][] jauS2pv(double theta, double phi, double r,
19240                  double td, double pd, double rd)
19241     {
19242        double pv[][] = new double[2][3];
19243        double st, ct, sp, cp, rcp, x, y, rpd, w;
19244 
19245 
19246        st = sin(theta);
19247        ct = cos(theta);
19248        sp = sin(phi);
19249        cp = cos(phi);
19250        rcp = r * cp;
19251        x = rcp * ct;
19252        y = rcp * st;
19253        rpd = r * pd;
19254        w = rpd*sp - cp*rd;
19255 
19256        pv[0][0] = x;
19257        pv[0][1] = y;
19258        pv[0][2] = r * sp;
19259        pv[1][0] = -y*td - w*ct;
19260        pv[1][1] =  x*td - w*st;
19261        pv[1][2] = rpd*cp + sp*rd;
19262 
19263        return pv;
19264 
19265         }
19266     
19267 
19268     /**
19269     *  Multiply a pv-vector by two scalars.
19270     *
19271     *<p>This function is derived from the International Astronomical Union's
19272     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19273     *
19274     *<p>Status:  vector/matrix support function.
19275     *
19276     *<!-- Given: -->
19277     *     @param s1      double          scalar to multiply position component by
19278     *     @param s2      double          scalar to multiply velocity component by
19279     *     @param pv      double[2][3]    pv-vector
19280     *
19281     *<!-- Returned: -->
19282     *     @return spv     double[2][3]     <u>returned</u> pv-vector: p scaled by s1, v scaled by s2
19283     *
19284     *  Note:
19285     *     It is permissible for pv and spv to be the same array.
19286     *
19287     *<p>Called:<ul>
19288     *     <li>{@link #jauSxp} multiply p-vector by scalar
19289     * </ul>
19290     *@version 2008 October 28
19291     *
19292     *  @since Release 20101201
19293     *
19294     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19295     */
19296     public static double[][] jauS2xpv(double s1, double s2, double pv[][])
19297     {
19298         double spv[][] = new double[2][3];
19299         spv[0] = jauSxp(s1, pv[0]);
19300         spv[1] =jauSxp(s2, pv[1]);
19301 
19302        return spv;
19303 
19304         }
19305     
19306 
19307     /**
19308     *  Angular separation between two p-vectors.
19309     *
19310     *<p>This function is derived from the International Astronomical Union's
19311     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19312     *
19313     *<p>Status:  vector/matrix support function.
19314     *
19315     *<!-- Given: -->
19316     *     @param a       double[3]     first p-vector (not necessarily unit length)
19317     *     @param b       double[3]     second p-vector (not necessarily unit length)
19318     *
19319     * <!-- Returned (function value): -->
19320     *  @return double       angular separation (radians, always positive)
19321     *
19322     * <p>Notes:
19323     * <ol>
19324     *
19325     * <li> If either vector is null, a zero result is returned.
19326     *
19327     * <li> The angular separation is most simply formulated in terms of
19328     *     scalar product.  However, this gives poor accuracy for angles
19329     *     near zero and pi.  The present algorithm uses both cross product
19330     *     and dot product, to deliver full accuracy whatever the size of
19331     *     the angle.
19332     *</ol>
19333     *<p>Called:<ul>
19334     *     <li>{@link #jauPxp} vector product of two p-vectors
19335     *     <li>{@link #jauPm} modulus of p-vector
19336     *     <li>{@link #jauPdp} scalar product of two p-vectors
19337     * </ul>
19338     *@version 2008 May 22
19339     *
19340     *  @since Release 20101201
19341     *
19342     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19343     */
19344     public static double jauSepp(double a[] , double b[] )
19345     {
19346        double axb[] = new double[3], ss, cs, s;
19347 
19348 
19349     /* Sine of angle between the vectors, multiplied by the two moduli. */
19350        axb = jauPxp(a,b);
19351        ss = jauPm(axb);
19352 
19353     /* Cosine of the angle, multiplied by the two moduli. */
19354        cs = jauPdp(a, b);
19355 
19356     /* The angle. */
19357        s = ((ss != 0.0) || (cs != 0.0)) ? atan2(ss, cs) : 0.0;
19358 
19359        return s;
19360 
19361         }
19362     
19363 
19364     /**
19365     *  Angular separation between two sets of spherical coordinates.
19366     *
19367     *<p>This function is derived from the International Astronomical Union's
19368     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19369     *
19370     *<p>Status:  vector/matrix support function.
19371     *
19372     *<!-- Given: -->
19373     *     @param al      double        first longitude (radians)
19374     *     @param ap      double        first latitude (radians)
19375     *     @param bl      double        second longitude (radians)
19376     *     @param bp      double        second latitude (radians)
19377     *
19378     * <!-- Returned (function value): -->
19379     *  @return double       angular separation (radians)
19380     *
19381     *<p>Called:<ul>
19382     *     <li>{@link #jauS2c} spherical coordinates to unit vector
19383     *     <li>{@link #jauSepp} angular separation between two p-vectors
19384     * </ul>
19385     *@version 2008 May 16
19386     *
19387     *  @since Release 20101201
19388     *
19389     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19390     */
19391     public static double jauSeps(double al, double ap, double bl, double bp)
19392     {
19393        double ac[] = new double[3], bc[] = new double[3], s;
19394 
19395 
19396     /* Spherical to Cartesian. */
19397        ac = jauS2c(al,ap);
19398        bc = jauS2c(bl,bp);
19399 
19400     /* Angle between the vectors. */
19401        s = jauSepp(ac, bc);
19402 
19403        return s;
19404 
19405         }
19406     
19407 
19408     /**
19409     *  The TIO locator s', positioning the Terrestrial Intermediate Origin
19410     *  on the equator of the Celestial Intermediate Pole.
19411     *
19412     *<p>This function is derived from the International Astronomical Union's
19413     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19414     *
19415     *<p>Status:  canonical model.
19416     *
19417     *<!-- Given: -->
19418     *     @param date1 double TT as a 2-part Julian Date (Note 1)
19419     *     @param date2 double TT as a 2-part Julian Date (Note 1)
19420     *
19421     * <!-- Returned (function value): -->
19422     *  @return double    the TIO locator s' in radians (Note 2)
19423     *
19424     * <p>Notes:
19425     * <ol>
19426     *
19427     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
19428     *     convenient way between the two arguments.  For example,
19429     *     JD(TT)=2450123.7 could be expressed in any of these ways,
19430     *     among others:
19431     *<pre>
19432     *            date1          date2
19433     *
19434     *         2450123.7           0.0       (JD method)
19435     *         2451545.0       -1421.3       (J2000 method)
19436     *         2400000.5       50123.2       (MJD method)
19437     *         2450123.5           0.2       (date &amp; time method)
19438     *</pre>
19439     *     The JD method is the most natural and convenient to use in
19440     *     cases where the loss of several decimal digits of resolution
19441     *     is acceptable.  The J2000 method is best matched to the way
19442     *     the argument is handled internally and will deliver the
19443     *     optimum resolution.  The MJD method and the date &amp; time methods
19444     *     are both good compromises between resolution and convenience.
19445     *
19446     * <li> The TIO locator s' is obtained from polar motion observations by
19447     *     numerical integration, and so is in essence unpredictable.
19448     *     However, it is dominated by a secular drift of about
19449     *     47 microarcseconds per century, which is the approximation
19450     *     evaluated by the present function.
19451     *</ol>
19452     *<p>Reference:
19453     *
19454     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
19455     *     IERS Technical Note No. 32, BKG (2004)
19456     *
19457     *@version 2008 May 24
19458     *
19459     *  @since Release 20101201
19460     *
19461     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19462     */
19463     public static double jauSp00(double date1, double date2)
19464     {
19465        double t, sp;
19466 
19467 
19468     /* Interval between fundamental epoch J2000.0 and current date (JC). */
19469        t = ((date1 - DJ00) + date2) / DJC;
19470 
19471     /* Approximate s'. */
19472        sp = -47e-6 * t * DAS2R;
19473 
19474        return sp;
19475 
19476         }
19477     
19478 
19479     /**
19480     *  Star proper motion:  update star catalog data for space motion.
19481     *
19482     *<p>This function is derived from the International Astronomical Union's
19483     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19484     *
19485     *<p>Status:  support function.
19486     *
19487     *<!-- Given: -->
19488     *     @param ra1     double      right ascension (radians), before
19489     *     @param dec1    double      declination (radians), before
19490     *     @param pmr1    double      RA proper motion (radians/year), before
19491     *     @param pmd1    double      Dec proper motion (radians/year), before
19492     *     @param px1     double      parallax (arcseconds), before
19493     *     @param rv1     double      radial velocity (km/s, +ve = receding), before
19494     *     @param ep1a    double      "before" epoch, part A (Note 1)
19495     *     @param ep1b    double      "before" epoch, part B (Note 1)
19496     *     @param ep2a    double      "after" epoch, part A (Note 1)
19497     *     @param ep2b    double      "after" epoch, part B (Note 1)
19498     *
19499     *<!-- Returned: -->
19500     *     @return ra2     double       <u>returned</u> right ascension (radians), after
19501     *             dec2    double       <u>returned</u> declination (radians), after
19502     *             pmr2    double       <u>returned</u> RA proper motion (radians/year), after
19503     *             pmd2    double       <u>returned</u> Dec proper motion (radians/year), after
19504     *             px2     double       <u>returned</u> parallax (arcseconds), after
19505     *             rv2     double       <u>returned</u> radial velocity (km/s, +ve = receding), after
19506     *
19507     * <!-- Returned (function value): -->
19508     *  @return int        status:
19509     *                          -1 = system error (should not occur)
19510     *                           0 = no warnings or errors
19511     *                           1 = distance overridden (Note 6)
19512     *                           2 = excessive velocity (Note 7)
19513     *                           4 = solution didn't converge (Note 8)
19514     *                        else = binary logical OR of the above warnings
19515     *FIXME need to return the status as well.
19516     * <p>Notes:
19517     * <ol>
19518     *
19519     * <li> The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are
19520     *     Julian Dates, apportioned in any convenient way between the two
19521     *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
19522     *     expressed in any of these ways, among others:
19523     *<pre>
19524     *             epna          epnb
19525     *
19526     *         2450123.7           0.0       (JD method)
19527     *         2451545.0       -1421.3       (J2000 method)
19528     *         2400000.5       50123.2       (MJD method)
19529     *         2450123.5           0.2       (date &amp; time method)
19530     *</pre>
19531     *     The JD method is the most natural and convenient to use in
19532     *     cases where the loss of several decimal digits of resolution
19533     *     is acceptable.  The J2000 method is best matched to the way
19534     *     the argument is handled internally and will deliver the
19535     *     optimum resolution.  The MJD method and the date &amp; time methods
19536     *     are both good compromises between resolution and convenience.
19537     *
19538     * <li> In accordance with normal star-catalog conventions, the object's
19539     *     right ascension and declination are freed from the effects of
19540     *     secular aberration.  The frame, which is aligned to the catalog
19541     *     equator and equinox, is Lorentzian and centered on the SSB.
19542     *
19543     *     The proper motions are the rate of change of the right ascension
19544     *     and declination at the catalog epoch and are in radians per TDB
19545     *     Julian year.
19546     *
19547     *     The parallax and radial velocity are in the same frame.
19548     *
19549     * <li> Care is needed with units.  The star coordinates are in radians
19550     *     and the proper motions in radians per Julian year, but the
19551     *     parallax is in arcseconds.
19552     *
19553     * <li> The RA proper motion is in terms of coordinate angle, not true
19554     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19555     *     motions, the RA proper motion will need to be divided by cos(Dec)
19556     *     before use.
19557     *
19558     * <li> Straight-line motion at constant speed, in the inertial frame,
19559     *     is assumed.
19560     *
19561     * <li> An extremely small (or zero or negative) parallax is interpreted
19562     *     to mean that the object is on the "celestial sphere", the radius
19563     *     of which is an arbitrary (large) value (see the jauStarpv
19564     *     function for the value used).  When the distance is overridden in
19565     *     this way, the status, initially zero, has 1 added to it.
19566     *
19567     * <li> If the space velocity is a significant fraction of c (see the
19568     *     constant VMAX in the function jauStarpv),  it is arbitrarily set
19569     *     to zero.  When this action occurs, 2 is added to the status.
19570     *
19571     * <li> The relativistic adjustment carried out in the jauStarpv function
19572     *     involves an iterative calculation.  If the process fails to
19573     *     converge within a set number of iterations, 4 is added to the
19574     *     status.
19575     *</ol>
19576     *<p>Called:<ul>
19577     *     <li>{@link #jauStarpv} star catalog data to space motion pv-vector
19578     *     <li>{@link #jauPvu} update a pv-vector
19579     *     <li>{@link #jauPdp} scalar product of two p-vectors
19580     *     <li>{@link #jauPvstar} space motion pv-vector to star catalog data
19581     * </ul>
19582     *@version 2008 May 16
19583     *
19584     *  @since Release 20101201
19585     *
19586     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19587     */
19588     public static CatalogCoords jauStarpm(double ra1, double dec1,
19589                   double pmr1, double pmd1, double px1, double rv1,
19590                   double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
19591     {
19592        double pv1[][] = new double[2][3], tl1, dt, pv[][] = new double[2][3], r2, rdv, v2, c2mv2, tl2,
19593               pv2[][] = new double[2][3];
19594        jauStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
19595 
19596     /* Light time when observed (days). */
19597        tl1 = jauPm(pv1[0]) / DC;
19598 
19599     /* Time interval, "before" to "after" (days). */
19600        dt = (ep2a - ep1a) + (ep2b - ep1b);
19601 
19602     /* Move star along track from the "before" observed position to the */
19603     /* "after" geometric position. */
19604        pv = jauPvu(dt + tl1, pv1);
19605 
19606     /* From this geometric position, deduce the observed light time (days) */
19607     /* at the "after" epoch (with theoretically unneccessary error check). */
19608        r2 = jauPdp(pv[0], pv[0]);
19609        rdv = jauPdp(pv[0], pv[1]);
19610        v2 = jauPdp(pv[1], pv[1]);
19611        c2mv2 = DC*DC - v2;
19612        if (c2mv2 <=  0) throw new JSOFAInternalError("internal error", -1);
19613        tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
19614 
19615     /* Move the position along track from the observed place at the */
19616     /* "before" epoch to the observed place at the "after" epoch. */
19617        pv2 =jauPvu(dt + (tl1 - tl2), pv1 );
19618 
19619     /* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */
19620        CatalogCoords cat = jauPvstar(pv2);
19621 
19622        return cat;
19623 
19624         }
19625     
19626 
19627     /**
19628     *  Convert star catalog coordinates to position+velocity vector.
19629     *
19630     *<p>This function is derived from the International Astronomical Union's
19631     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19632     *
19633     *<p>Status:  support function.
19634     *
19635     *  Given (Note 1):
19636     *   @param  ra     double        right ascension (radians)
19637     *   @param  dec    double        declination (radians)
19638     *   @param  pmr    double        RA proper motion (radians/year)
19639     *   @param  pmd    double        Dec proper motion (radians/year)
19640     *   @param  px     double        parallax (arcseconds)
19641     *   @param  rv     double        radial velocity (km/s, positive = receding)
19642     *
19643     *  Returned (Note 2):
19644     *   @param  pv     double[2][3]  pv-vector (au, au/day)
19645     *
19646     * <!-- Returned (function value): -->
19647     *  @return int           status:
19648     *                              0 = no warnings
19649     *                              1 = distance overridden (Note 6)
19650     *                              2 = excessive speed (Note 7)
19651     *                              4 = solution didn't converge (Note 8)
19652     *                           else = binary logical OR of the above
19653     *
19654     * <p>Notes:
19655     * <ol>
19656     *
19657     * <li> The star data accepted by this function are "observables" for an
19658     *     imaginary observer at the solar-system barycenter.  Proper motion
19659     *     and radial velocity are, strictly, in terms of barycentric
19660     *     coordinate time, TCB.  For most practical applications, it is
19661     *     permissible to neglect the distinction between TCB and ordinary
19662     *     "proper" time on Earth (TT/TAI).  The result will, as a rule, be
19663     *     limited by the intrinsic accuracy of the proper-motion and
19664     *     radial-velocity data;  moreover, the pv-vector is likely to be
19665     *     merely an intermediate result, so that a change of time unit
19666     *     would cancel out overall.
19667     *
19668     *     In accordance with normal star-catalog conventions, the object's
19669     *     right ascension and declination are freed from the effects of
19670     *     secular aberration.  The frame, which is aligned to the catalog
19671     *     equator and equinox, is Lorentzian and centered on the SSB.
19672     *
19673     * <li> The resulting position and velocity pv-vector is with respect to
19674     *     the same frame and, like the catalog coordinates, is freed from
19675     *     the effects of secular aberration.  Should the "coordinate
19676     *     direction", where the object was located at the catalog epoch, be
19677     *     required, it may be obtained by calculating the magnitude of the
19678     *     position vector pv[0][0-2] dividing by the speed of light in
19679     *     au/day to give the light-time, and then multiplying the space
19680     *     velocity pv[1][0-2] by this light-time and adding the result to
19681     *     pv[0][0-2].
19682     *
19683     *     Summarizing, the pv-vector returned is for most stars almost
19684     *     identical to the result of applying the standard geometrical
19685     *     "space motion" transformation.  The differences, which are the
19686     *     subject of the Stumpff paper referenced below, are:
19687     *
19688     *     (i) In stars with significant radial velocity and proper motion,
19689     *     the constantly changing light-time distorts the apparent proper
19690     *     motion.  Note that this is a classical, not a relativistic,
19691     *     effect.
19692     *
19693     *     (ii) The transformation complies with special relativity.
19694     *
19695     * <li> Care is needed with units.  The star coordinates are in radians
19696     *     and the proper motions in radians per Julian year, but the
19697     *     parallax is in arcseconds; the radial velocity is in km/s, but
19698     *     the pv-vector result is in au and au/day.
19699     *
19700     * <li> The RA proper motion is in terms of coordinate angle, not true
19701     *     angle.  If the catalog uses arcseconds for both RA and Dec proper
19702     *     motions, the RA proper motion will need to be divided by cos(Dec)
19703     *     before use.
19704     *
19705     * <li> Straight-line motion at constant speed, in the inertial frame,
19706     *     is assumed.
19707     *
19708     * <li> An extremely small (or zero or negative) parallax is interpreted
19709     *     to mean that the object is on the "celestial sphere", the radius
19710     *     of which is an arbitrary (large) value (see the constant PXMIN).
19711     *     When the distance is overridden in this way, the status,
19712     *     initially zero, has 1 added to it.
19713     *
19714     * <li> If the space velocity is a significant fraction of c (see the
19715     *     constant VMAX), it is arbitrarily set to zero.  When this action
19716     *     occurs, 2 is added to the status.
19717     *
19718     * <li> The relativistic adjustment involves an iterative calculation.
19719     *     If the process fails to converge within a set number (IMAX) of
19720     *     iterations, 4 is added to the status.
19721     *
19722     * <li> The inverse transformation is performed by the function
19723     *     jauPvstar.
19724     *</ol>
19725     *<p>Called:<ul>
19726     *     <li>{@link #jauS2pv} spherical coordinates to pv-vector
19727     *     <li>{@link #jauPm} modulus of p-vector
19728     *     <li>{@link #jauZp} zero p-vector
19729     *     <li>{@link #jauPn} decompose p-vector into modulus and direction
19730     *     <li>{@link #jauPdp} scalar product of two p-vectors
19731     *     <li>{@link #jauSxp} multiply p-vector by scalar
19732     *     <li>{@link #jauPmp} p-vector minus p-vector
19733     *     <li>{@link #jauPpp} p-vector plus p-vector
19734     * </ul>
19735     *<p>Reference:
19736     *
19737     *     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
19738     *
19739     *@version 2009 July 6
19740     *
19741     *  @since Release 20101201
19742     *
19743     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19744     */
19745     public static int jauStarpv(double ra, double dec,
19746                   double pmr, double pmd, double px, double rv,
19747                   double pv[][])
19748     {
19749     /* Smallest allowed parallax */
19750        final double PXMIN = 1e-7;
19751 
19752     /* Largest allowed speed (fraction of c) */
19753        final double VMAX = 0.5;
19754 
19755     /* Maximum number of iterations for relativistic solution */
19756        final int IMAX = 100;
19757 
19758        int i, iwarn;
19759        double w, r, rd, rad, decd, v, x[] = new double[3], usr[] = new double[3], ust[] = new double[3],
19760               vsr, vst, betst, betsr, bett, betr,
19761               dd, ddel, ur[] = new double[3], ut[] = new double[3],
19762               d = 0.0, del = 0.0,       /* to prevent */
19763               odd = 0.0, oddel = 0.0,   /* compiler   */
19764               od = 0.0, odel = 0.0;     /* warnings   */
19765 
19766 
19767     /* Distance (au). */
19768        if (px >= PXMIN) {
19769           w = px;
19770           iwarn = 0;
19771        } else {
19772           w = PXMIN;
19773           iwarn = 1;
19774        }
19775        r = DR2AS / w;
19776 
19777     /* Radial velocity (au/day). */
19778        rd = DAYSEC * rv * 1e3 / DAU;
19779 
19780     /* Proper motion (radian/day). */
19781        rad = pmr / DJY;
19782        decd = pmd / DJY;
19783 
19784     /* To pv-vector (au,au/day). */
19785        double[][] pvt = jauS2pv(ra, dec, r, rad, decd, rd);
19786        jauCpv(pvt,pv);
19787 
19788     /* If excessive velocity, arbitrarily set it to zero. */
19789        v = jauPm(pv[1]);
19790        if (v / DC > VMAX) {
19791           jauZp(pv[1]);
19792           iwarn += 2;
19793        }
19794 
19795     /* Isolate the radial component of the velocity (au/day). */
19796        NormalizedVector nv = jauPn(pv[0]);
19797        w = nv.r;
19798        x = nv.u;
19799        vsr = jauPdp(x, pv[1]);
19800        usr = jauSxp(vsr,x);
19801 
19802     /* Isolate the transverse component of the velocity (au/day). */
19803        ust = jauPmp(pv[1], usr);
19804        vst = jauPm(ust);
19805 
19806     /* Special-relativity dimensionless parameters. */
19807        betsr = vsr / DC;
19808        betst = vst / DC;
19809 
19810     /* Determine the inertial-to-observed relativistic correction terms. */
19811        bett = betst;
19812        betr = betsr;
19813        for (i = 0; i < IMAX; i++) {
19814           d = 1.0 + betr;
19815           del = sqrt(1.0 - betr*betr - bett*bett) - 1.0;
19816           betr = d * betsr + del;
19817           bett = d * betst;
19818           if (i > 0) {
19819              dd = abs(d - od);
19820              ddel = abs(del - odel);
19821              if ((i > 1) && (dd >= odd) && (ddel >= oddel)) break;
19822              odd = dd;
19823              oddel = ddel;
19824           }
19825           od = d;
19826           odel = del;
19827        }
19828        if (i >= IMAX) iwarn += 4;
19829 
19830     /* Replace observed radial velocity with inertial value. */
19831        w = (betsr != 0.0) ? d + del / betsr : 1.0;
19832        ur = jauSxp(w,usr);
19833 
19834     /* Replace observed tangential velocity with inertial value. */
19835        ut = jauSxp(d,ust);
19836 
19837     /* Combine the two to obtain the inertial space velocity. */
19838        pv[1] = jauPpp(ur, ut);
19839        
19840     /* Return the status. */
19841        return iwarn;
19842 
19843         }
19844     
19845 
19846     /**
19847     *  Multiply a p-vector by a scalar.
19848     *
19849     *<p>This function is derived from the International Astronomical Union's
19850     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19851     *
19852     *<p>Status:  vector/matrix support function.
19853     *
19854     *<!-- Given: -->
19855     *     @param s       double         scalar
19856     *     @param p       double[3]      p-vector
19857     *
19858     *<!-- Returned: -->
19859     *     @return sp      double[3]       <u>returned</u> s * p
19860     *
19861     * 
19862     *
19863     *@version 2008 October 28
19864     *
19865     *  @since Release 20101201
19866     *
19867     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19868     */
19869     public static  double[] jauSxp(double s, double p[])
19870     {
19871        double sp[] = new double[3];
19872        sp[0] = s * p[0];
19873        sp[1] = s * p[1];
19874        sp[2] = s * p[2];
19875 
19876        return sp;
19877 
19878         }
19879     
19880 
19881     /**
19882     *  Multiply a pv-vector by a scalar.
19883     *
19884     *<p>This function is derived from the International Astronomical Union's
19885     *  SOFA (Standards Of Fundamental Astronomy) software collection.
19886     *
19887     *<p>Status:  vector/matrix support function.
19888     *
19889     *<!-- Given: -->
19890     *     @param s        double           scalar
19891     *     @param pv       double[2][3]     pv-vector
19892     *
19893     *<!-- Returned: -->
19894     *     @return spv      double[2][3]      <u>returned</u> s * pv
19895     *
19896     *  Note:
19897     *     It is permissible for pv and psv to be the same array
19898     *
19899     *<p>Called:<ul>
19900     *     <li>{@link #jauS2xpv} multiply pv-vector by two scalars
19901     * </ul>
19902     *@version 2008 October 28
19903     *
19904     *  @since Release 20101201
19905     *
19906     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
19907     */
19908     public static double[][] jauSxpv(double s, double pv[][])
19909     {
19910         double spv[][];
19911         spv = jauS2xpv(s, s, pv);
19912 
19913        return spv;
19914 
19915         }
19916 
19917     /**
19918      *
19919      *  Time scale transformation:  International Atomic Time, TAI, to
19920      *  Terrestrial Time, TT.
19921      *
19922      * <p>This function is derived from the International Astronomical Union's
19923      *  SOFA (Standards of Fundamental Astronomy) software collection.
19924      *
19925      *<p>Status:  canonical.
19926      *
19927      *<!-- Given: -->
19928      *  @param tai1 double    TAI as a 2-part Julian Date
19929      *  @param tai2 double    TAI as a 2-part Julian Date 
19930      *
19931      *<!-- Returned:-->
19932      *     @return JulianDate   TT as a 2-part Julian Date
19933      *
19934      *
19935      *  Note:
19936      *
19937      *     tai1+tai2 is Julian Date, apportioned in any convenient way
19938      *     between the two arguments, for example where tai1 is the Julian
19939      *     Day Number and tai2 is the fraction of a day.  The returned
19940      *     tt1,tt2 follow suit.
19941      *
19942      *<p>References:
19943      *
19944      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
19945      *     IERS Technical Note No. 32, BKG (2004)
19946      *
19947      *     Explanatory Supplement to the Astronomical Almanac,
19948      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
19949      *
19950      *@version 2010 May 16
19951      *
19952      *@since SOFA release 2010-12-01
19953      *
19954      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
19955      */
19956     public static JulianDate jauTaitt(double tai1, double tai2)
19957     {
19958 
19959         double tt1, tt2;
19960         /* TT minus TAI (days). */
19961         final double dtat = TTMTAI / DAYSEC;
19962 
19963         /* Result, safeguarding precision. */
19964         
19965         if ( tai1 > tai2 ) {
19966             tt1 = tai1;
19967             tt2 = tai2 + dtat;
19968         } else {
19969             tt1 = tai1 + dtat;
19970             tt2 = tai2;
19971         }
19972 
19973 
19974         return new JulianDate(tt1, tt2);
19975     };   
19976 
19977     /**
19978      *
19979      *  Time scale transformation:  International Atomic Time, TAI, to
19980      *  Universal Time, UT1.
19981      *
19982      * <p>This function is derived from the International Astronomical Union's
19983      *  SOFA (Standards of Fundamental Astronomy) software collection.
19984      *
19985      *<p>Status:  canonical.
19986      *
19987      *<!-- Given: -->
19988      *  @param tai1 double    TAI as a 2-part Julian Date
19989      *  @param tai2 double    TAI as a 2-part Julian Date 
19990      *  @param   dta        double    UT1-TAI in seconds
19991      *
19992      *<!-- Returned:-->
19993      *  @return      UT1 as a 2-part Julian Date
19994      *
19995      *
19996      *<p>Notes:
19997      *  <ol>
19998      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
19999      *     between the two arguments, for example where tai1 is the Julian
20000      *     Day Number and tai2 is the fraction of a day.  The returned
20001      *     UT11,UT12 follow suit.
20002      *
20003      *  <li>  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
20004      *     available from IERS tabulations.
20005      *  </ol>
20006      *  Reference:
20007      *
20008      *     Explanatory Supplement to the Astronomical Almanac,
20009      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20010      *
20011      *@version 2010 May 16
20012      *
20013      *@since SOFA release 2010-12-01
20014      *
20015      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20016      *
20017      */
20018     public static JulianDate jauTaiut1(double tai1, double tai2, double dta)
20019 
20020     {
20021         double dtad,ut11, ut12;
20022 
20023 
20024         /* Result, safeguarding precision. */
20025         dtad = dta / DAYSEC;
20026         if ( tai1 > tai2 ) {
20027             ut11 = tai1;
20028             ut12 = tai2 + dtad;
20029         } else {
20030             ut11 = tai1 + dtad;
20031             ut12 = tai2;
20032         }
20033 
20034         return new JulianDate(ut11, ut12);
20035     };   
20036 
20037     /**
20038      *
20039      *  Time scale transformation:  International Atomic Time, TAI, to
20040      *  Coordinated Universal Time, UTC.
20041      *
20042      * <p>This function is derived from the International Astronomical Union's
20043      *  SOFA (Standards of Fundamental Astronomy) software collection.
20044      *
20045      *<p>Status:  canonical.
20046      *
20047      *<!-- Given: -->
20048      *  @param tai1 TAI as a 2-part Julian Date (Note 1)
20049      *  @param tai2 TAI as a 2-part Julian Date (Note 1) 
20050      *
20051      *<!-- Returned:-->
20052      *  @return   UTC as a 2-part quasi Julian Date (Notes 1-3)
20053      *
20054      *  Returned (function value):
20055      *                int      status: +1 = dubious year (Note 4)
20056      *                                  0 = OK
20057      *                                 -1 = unacceptable date
20058      *
20059      *<p>Notes:</p>
20060      * <ol>
20061      * <li>  tai1+tai2 is Julian Date, apportioned in any convenient way
20062      *     between the two arguments, for example where tai1 is the Julian
20063      *     Day Number and tai2 is the fraction of a day.  The returned utc1
20064      *     and utc2 form an analogous pair, except that a special convention
20065      *     is used, to deal with the problem of leap seconds - see the next
20066      *     note.
20067      *
20068      *  <li> JD cannot unambiguously represent UTC during a leap second unless
20069      *     special measures are taken.  The convention in the present
20070      *     function is that the JD day represents UTC days whether the
20071      *     length is 86399, 86400 or 86401 SI seconds.
20072      *
20073      *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
20074      *     into calendar date and clock time, including UTC leap second
20075      *     handling.
20076      *
20077      *  <li> The warning status "dubious year" flags UTCs that predate the
20078      *     introduction of the time scale and that are too far in the future
20079      *     to be trusted.  See jauDat for further details.
20080      *  </ol>
20081      *  Called:
20082      *  <ul>
20083      *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
20084      *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
20085      *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
20086      *</ul>
20087      *<p>References:
20088      *
20089      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20090      *     IERS Technical Note No. 32, BKG (2004)
20091      *
20092      *     Explanatory Supplement to the Astronomical Almanac,
20093      *     P. Kenneth Seidelmann (ed), University Science Books (1992)
20094      *
20095      *@version 2010 May 16
20096      *
20097      *@since SOFA release 2010-12-01
20098      *
20099      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20100      * @throws JSOFAIllegalParameter 
20101      * @throws JSOFAInternalError an internal error has occured
20102      */
20103     public static JulianDate jauTaiutc(double tai1, double tai2) throws JSOFAIllegalParameter, JSOFAInternalError
20104     {
20105         boolean big1;
20106         int i;
20107         double a1, a2,dats1, ddats, dats2, datd = 0.0, as1, as2, da, d1, d2, fd;
20108         double utc1, utc2;
20109 
20110 
20111         /* Put the two parts of the TAI into big-first order. */
20112         big1 = ( tai1 >= tai2 );
20113         if ( big1 ) {
20114             a1 = tai1;
20115             a2 = tai2;
20116         } else {
20117             a1 = tai2;
20118             a2 = tai1;
20119         }
20120 
20121         /* See if the TAI can possibly be in a leap-second day. */
20122         d1 = a1;
20123         dats1 = 0.0;
20124         for ( i = -1; i <= 3; i++ ) {
20125             d2 = a2 + (double) i;
20126             Calendar dt;
20127             dt = jauJd2cal(d1, d2 );
20128             dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
20129 //FIXME            if ( js < 0 ) return -1;
20130             if ( i == -1 ) dats1 = dats2;
20131             ddats = dats2 - dats1;
20132             datd = dats1 / DAYSEC;
20133             if ( abs(ddats) >= 0.5 ) {
20134 
20135                 /* Yes.  Get TAI for the start of the UTC day that */
20136                 /* ends in a leap. */
20137                 JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
20138                 d1 = jd.djm0; d2 = jd.djm1;
20139                 as1 = d1;
20140                 as2 = d2 - 1.0 + datd;
20141 
20142                 /* Is the TAI after this point? */
20143                 da = a1 - as1;
20144                 da = da + ( a2 - as2 );
20145                 if ( da > 0 ) {
20146 
20147                     /* Yes:  fraction of the current UTC day that has elapsed. */
20148                     fd = da * DAYSEC / ( DAYSEC + ddats );
20149 
20150                     /* Ramp TAI-UTC to bring about SOFA's JD(UTC) convention. */
20151                     datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / DAYSEC;
20152                 }
20153 
20154                 /* Done. */
20155                 break;
20156             }
20157             dats1 = dats2;
20158         }
20159 
20160         /* Subtract the (possibly adjusted) TAI-UTC from TAI to give UTC. */
20161         a2 -= datd;
20162 
20163         /* Return the UTC result, preserving the TAI order. */
20164         if ( big1 ) {
20165             utc1 = a1;
20166             utc2 = a2;
20167         } else {
20168             utc1 = a2;
20169             utc2 = a1;
20170         }
20171 
20172         /* TODO Status */
20173         return new JulianDate(utc1, utc2);
20174 
20175     };
20176 
20177     /**
20178      *
20179      *  Time scale transformation:  Barycentric Coordinate Time, TCB, to
20180      *  Barycentric Dynamical Time, TDB.
20181      *
20182      * <p>This function is derived from the International Astronomical Union's
20183      *  SOFA (Standards of Fundamental Astronomy) software collection.
20184      *
20185      *<p>Status:  canonical.
20186      *
20187      *<!-- Given: -->
20188      *   @param tcb1 double    TCB as a 2-part Julian Date
20189      *   @param tcb2 double    TCB as a 2-part Julian Date 
20190      *
20191      *<!-- Returned:-->
20192      *   @return    TDB as a 2-part Julian Date
20193      *
20194      *
20195      *<p>Notes:
20196      *  <ol>
20197      * <li>  tcb1+tcb2 is Julian Date, apportioned in any convenient way
20198      *     between the two arguments, for example where tcb1 is the Julian
20199      *     Day Number and tcb2 is the fraction of a day.  The returned
20200      *     tdb1,tdb2 follow suit.
20201      *
20202      * <li>  The 2006 IAU General Assembly introduced a conventional linear
20203      *     transformation between TDB and TCB.  This transformation
20204      *     compensates for the drift between TCB and terrestrial time TT,
20205      *     and keeps TDB approximately centered on TT.  Because the
20206      *     relationship between TT and TCB depends on the adopted solar
20207      *     system ephemeris, the degree of alignment between TDB and TT over
20208      *     long intervals will vary according to which ephemeris is used.
20209      *     Former definitions of TDB attempted to avoid this problem by
20210      *     stipulating that TDB and TT should differ only by periodic
20211      *     effects.  This is a good description of the nature of the
20212      *     relationship but eluded precise mathematical formulation.  The
20213      *     conventional linear relationship adopted in 2006 sidestepped
20214      *     these difficulties whilst delivering a TDB that in practice was
20215      *     consistent with values before that date.
20216      *
20217      *  <li>  TDB is essentially the same as Teph, the time argument for the
20218      *     JPL solar system ephemerides.
20219      * </ol>
20220      *  Reference:
20221      *
20222      *     IAU 2006 Resolution B3
20223      *
20224      *@version 2010 May 16
20225      *
20226      *@since SOFA release 2010-12-01
20227      *
20228      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20229      */
20230     public static JulianDate jauTcbtdb(double tcb1, double tcb2)
20231     {
20232         double tdb1, tdb2;
20233         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20234         final double t77td = DJM0 + DJM77;
20235         final double t77tf = TTMTAI/DAYSEC;
20236 
20237         /* TDB (days) at TAI 1977 Jan 1.0 */
20238         final double tdb0 = TDB0/86400.0;
20239 
20240         double d;
20241 
20242 
20243         /* Result, safeguarding precision. */
20244         if ( tcb1 > tcb2 ) {
20245             d = tcb1 - t77td;
20246             tdb1 = tcb1;
20247             tdb2 = tcb2 + tdb0 - ( d + ( tcb2 - t77tf ) ) * ELB;
20248         } else {
20249             d = tcb2 - t77td;
20250             tdb1 = tcb1 + tdb0 - ( d + ( tcb1 - t77tf ) ) * ELB;
20251             tdb2 = tcb2;
20252         }
20253 
20254 
20255         return new JulianDate(tdb1, tdb2);
20256 
20257     };
20258 
20259     /**
20260      *  Time scale transformation:  Geocentric Coordinate Time, TCG, to
20261      *  Terrestrial Time, TT.
20262      *
20263      * <p>This function is derived from the International Astronomical Union's
20264      *  SOFA (Standards of Fundamental Astronomy) software collection.
20265      *
20266      *<p>Status:  canonical.
20267      *
20268      *<!-- Given: -->
20269      *  @param tcg1 double    TCG as a 2-part Julian Date
20270      *  @param tcg2 double    TCG as a 2-part Julian Date 
20271      *
20272      *<!-- Returned:-->
20273      *   @return    TT as a 2-part Julian Date
20274      *
20275      *
20276      *  Note:
20277      *
20278      *     tcg1+tcg2 is Julian Date, apportioned in any convenient way
20279      *     between the two arguments, for example where tcg1 is the Julian
20280      *     Day Number and tcg22 is the fraction of a day.  The returned
20281      *     tt1,tt2 follow suit.
20282      *
20283      *<p>References:
20284      *
20285      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),.
20286      *     IERS Technical Note No. 32, BKG (2004)
20287      *
20288      *     IAU 2000 Resolution B1.9
20289      *
20290      *@version 2010 May 14
20291      *
20292      *@since SOFA release 2010-12-01
20293      *
20294      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20295      */
20296     public static JulianDate jauTcgtt(double tcg1, double tcg2)
20297     {
20298         double tt1,tt2;
20299         /* 1977 Jan 1 00:00:32.184 TT, as MJD */
20300         final double t77t = DJM77 + TTMTAI/DAYSEC;
20301 
20302 
20303         /* Result, safeguarding precision. */
20304         if ( tcg1 > tcg2 ) {
20305             tt1 = tcg1;
20306             tt2 = tcg2 - ( ( tcg1 - DJM0 ) + ( tcg2 - t77t ) ) * ELG;
20307         } else {
20308             tt1 = tcg1 - ( ( tcg2 - DJM0 ) + ( tcg1 - t77t ) ) * ELG;
20309             tt2 = tcg2;
20310         }
20311 
20312         return new JulianDate(tt1, tt2);
20313     };
20314 
20315 
20316     /**
20317      *
20318      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20319      *  Barycentric Coordinate Time, TCB.
20320      *
20321      * <p>This function is derived from the International Astronomical Union's
20322      *  SOFA (Standards of Fundamental Astronomy) software collection.
20323      *
20324      *<p>Status:  canonical.
20325      *
20326      *<!-- Given: -->
20327      *   @param tdb1 TDB as a 2-part Julian Date
20328      *   @param tdb2 TDB as a 2-part Julian Date 
20329      *
20330      *<!-- Returned:-->
20331      *   @return    TCB as a 2-part Julian Date
20332      *
20333      *<p>Notes:
20334      * <ol>
20335      *  <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20336      *     between the two arguments, for example where tdb1 is the Julian
20337      *     Day Number and tdb2 is the fraction of a day.  The returned
20338      *     tcb1,tcb2 follow suit.
20339      *
20340      *  <li> The 2006 IAU General Assembly introduced a conventional linear
20341      *     transformation between TDB and TCB.  This transformation
20342      *     compensates for the drift between TCB and terrestrial time TT,
20343      *     and keeps TDB approximately centered on TT.  Because the
20344      *     relationship between TT and TCB depends on the adopted solar
20345      *     system ephemeris, the degree of alignment between TDB and TT over
20346      *     long intervals will vary according to which ephemeris is used.
20347      *     Former definitions of TDB attempted to avoid this problem by
20348      *     stipulating that TDB and TT should differ only by periodic
20349      *     effects.  This is a good description of the nature of the
20350      *     relationship but eluded precise mathematical formulation.  The
20351      *     conventional linear relationship adopted in 2006 sidestepped
20352      *     these difficulties whilst delivering a TDB that in practice was
20353      *     consistent with values before that date.
20354      *
20355      * <li>  TDB is essentially the same as Teph, the time argument for the
20356      *     JPL solar system ephemerides.
20357      *  </ol>
20358      *  Reference:
20359      *
20360      *     IAU 2006 Resolution B3
20361      *
20362      *@version 2010 September 10
20363      *
20364      *@since SOFA release 2010-12-01
20365      *
20366      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20367      */
20368     public static JulianDate jauTdbtcb(double tdb1, double tdb2 )
20369     {
20370         double tcb1, tcb2;
20371         /* 1977 Jan 1 00:00:32.184 TT, as two-part JD */
20372         final double t77td = DJM0 + DJM77;
20373         final double t77tf = TTMTAI/DAYSEC;
20374 
20375         /* TDB (days) at TAI 1977 Jan 1.0 */
20376         final double tdb0 = TDB0/DAYSEC;
20377 
20378         /* TDB to TCB rate */
20379         final double elbb = ELB/(1.0-ELB);
20380 
20381         double d, f;
20382 
20383 
20384         /* Result, preserving date format but safeguarding precision. */
20385         if ( tdb1 > tdb2 ) {
20386             d = t77td - tdb1;
20387             f  = tdb2 - tdb0;
20388             tcb1 = tdb1;
20389             tcb2 = f - ( d - ( f - t77tf ) ) * elbb;
20390         } else {
20391             d = t77td - tdb2;
20392             f  = tdb1 - tdb0;
20393             tcb1 = f + ( d - ( f - t77tf ) ) * elbb;
20394             tcb2 = tdb2;
20395         }
20396 
20397         return new JulianDate(tcb1, tcb2);
20398 
20399     };
20400 
20401 
20402     /**
20403      *
20404      *  Time scale transformation:  Barycentric Dynamical Time, TDB, to
20405      *  Terrestrial Time, TT.
20406      *
20407      * <p>This function is derived from the International Astronomical Union's
20408      *  SOFA (Standards of Fundamental Astronomy) software collection.
20409      *
20410      *<p>Status:  canonical.
20411      *
20412      *<!-- Given: -->
20413      *    @param tdb1 double    TDB as a 2-part Julian Date
20414      *    @param tdb2 double    TDB as a 2-part Julian Date 
20415      *    @param dtr        double    TDB-TT in seconds
20416      *
20417      *<!-- Returned:-->
20418      *   @return   TT as a 2-part Julian Date
20419      *
20420      *
20421      *<p>Notes:
20422      * <ol>
20423      * <li>  tdb1+tdb2 is Julian Date, apportioned in any convenient way
20424      *     between the two arguments, for example where tdb1 is the Julian
20425      *     Day Number and tdb2 is the fraction of a day.  The returned
20426      *     tt1,tt2 follow suit.
20427      *
20428      *  <li>  The argument dtr represents the quasi-periodic component of the
20429      *     GR transformation between TT and TCB.  It is dependent upon the
20430      *     adopted solar-system ephemeris, and can be obtained by numerical
20431      *     integration, by interrogating a precomputed time ephemeris or by
20432      *     evaluating a model such as that implemented in the SOFA function
20433      *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
20434      *     amplitude.
20435      *
20436      *  <li>  TDB is essentially the same as Teph, the time argument for the
20437      *     JPL solar system ephemerides.
20438      *  </ol>
20439      *<p>References:
20440      *
20441      *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
20442      *     IERS Technical Note No. 32, BKG (2004)
20443      *
20444      *     IAU 2006 Resolution 3
20445      *
20446      *@version 2010 May 13
20447      *
20448      *@since SOFA release 2010-12-01
20449      *
20450      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20451      *
20452      */
20453     public static JulianDate jauTdbtt(double tdb1, double tdb2, double dtr  )
20454     {
20455         double tt1, tt2;
20456         double dtrd;
20457 
20458 
20459         /* Result, safeguarding precision. */
20460         dtrd = dtr / DAYSEC;
20461         if ( tdb1 > tdb2 ) {
20462             tt1 = tdb1;
20463             tt2 = tdb2 - dtrd;
20464         } else {
20465             tt1 = tdb1 - dtrd;
20466             tt2 = tdb2;
20467         }
20468 
20469         return new JulianDate(tt1, tt2);
20470 
20471     }
20472 
20473     /**
20474      *
20475      *  Convert hours, minutes, seconds to radians.
20476      *
20477      * <p>This function is derived from the International Astronomical Union's
20478      *  SOFA (Standards of Fundamental Astronomy) software collection.
20479      *
20480      *<p>Status:  support function.
20481      *
20482      *<!-- Given: -->
20483      *     @param s         char     sign:  '-' = negative, otherwise positive
20484      *     @param ihour     int     hours
20485      *     @param imin      int     minutes
20486      *     @param sec       double  seconds
20487      *
20488      *<!-- Returned:-->
20489      *     @return      double  angle in radians
20490      *@throws JSOFAIllegalParameter illegal parameter of some form
20491      *  Returned (function value):
20492      *               int     status:  0 = OK
20493      *                                1 = ihour outside range 0-23
20494      *                                2 = imin outside range 0-59
20495      *                                3 = sec outside range 0-59.999...
20496      *
20497      *<p>Notes:
20498      *<ul>
20499      *  <li>  The result is computed even if any of the range checks fail.
20500      *
20501      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20502      *      the absolute value is used in the conversion.
20503      *</ul>
20504      *@version 2010 August 27
20505      *
20506      *@since SOFA release 2010-12-01
20507      *
20508      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20509      * 
20510      */
20511     public static double jauTf2a(char s, int ihour, int imin, double sec ) throws JSOFAIllegalParameter
20512     {
20513         double rad;
20514 
20515         /* Compute the interval. */
20516         rad  = ( s == '-' ? -1.0 : 1.0 ) *
20517                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20518                         ( (double) abs(imin) ) ) +
20519                         abs(sec) ) * DS2R;
20520 
20521         /*  Validate arguments and return status. */
20522         if ( ihour < 0 || ihour > 23 ) throw new JSOFAIllegalParameter("bad hour", 1);   
20523         if ( imin < 0 || imin > 59 )   throw new JSOFAIllegalParameter("bad minute", 2); 
20524         if ( sec < 0.0 || sec >= 60.0 )throw new JSOFAIllegalParameter("bad second", 3); 
20525         return rad;
20526 
20527     };
20528 
20529     /**
20530      *
20531      *  Convert hours, minutes, seconds to days.
20532      *
20533      * <p>This function is derived from the International Astronomical Union's
20534      *  SOFA (Standards of Fundamental Astronomy) software collection.
20535      *
20536      *<p>Status:  support function.
20537      *
20538      *<!-- Given: -->
20539      *     @param s         char     sign:  '-' = negative, otherwise positive
20540      *     @param ihour     int     hours
20541      *     @param imin      int     minutes
20542      *     @param sec       double  seconds
20543      *
20544      *<!-- Returned:-->
20545      *     days      double  interval in days
20546      *
20547      *  Returned (function value):
20548      *               int     status:  0 = OK
20549      *                                1 = ihour outside range 0-23
20550      *                                2 = imin outside range 0-59
20551      *                                3 = sec outside range 0-59.999...
20552      *
20553      *<p>Notes:
20554      *<ol>
20555      *  <li>  The result is computed even if any of the range checks fail.
20556      *
20557      *  <li>  Negative ihour, imin and/or sec produce a warning status, but
20558      *      the absolute value is used in the conversion.
20559      *</ol>
20560      *@version 2010 August 27
20561      *
20562      *@since SOFA release 2010-12-01
20563      *
20564      *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
20565      * @throws JSOFAIllegalParameter 
20566      */
20567     public static double jauTf2d(char s, int ihour, int imin, double sec) throws JSOFAIllegalParameter
20568     {
20569         double days;
20570         /* Compute the interval. */
20571         days  = ( s == '-' ? -1.0 : 1.0 ) *
20572                 ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
20573                         ( (double) abs(imin) ) ) +
20574                         abs(sec) ) / DAYSEC;
20575 
20576         /* FIXME Validate arguments and return status. */
20577         if ( ihour < 0 || ihour > 23 )  throw new JSOFAIllegalParameter("bad hour", 1);
20578         if ( imin < 0 || imin > 59 )    throw new JSOFAIllegalParameter("bad minute", 2);
20579         if ( sec < 0.0 || sec >= 60.0 ) throw new JSOFAIllegalParameter("bad second", 3);
20580         return days;
20581 
20582     }
20583 
20584     /**
20585      *  Transpose an r-matrix.
20586      *
20587      *<p>This function is derived from the International Astronomical Union's
20588      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20589      *
20590      *<p>Status:  vector/matrix support function.
20591      *
20592      *<!-- Given: -->
20593      *     @param r         double[3][3]     r-matrix
20594      *
20595      *<!-- Returned: -->
20596      *     @return rt        double[3][3]      <u>returned</u> transpose
20597      *
20598      *  Note:
20599      *     It is permissible for r and rt to be the same array.
20600      *
20601      *<p>Called:<ul>
20602      *     <li>{@link #jauCr} copy r-matrix
20603      * </ul>
20604      *@version 2008 May 22
20605      *
20606      *  @since Release 20101201
20607      *
20608      *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20609      */
20610     public static double[][] jauTr(double r[][])
20611     {
20612         double wm[][]= new double[3][3];
20613         int i, j;
20614 
20615 
20616         for (i = 0; i < 3; i++) {
20617             for (j = 0; j < 3; j++) {
20618                 wm[i][j] = r[j][i];
20619             }
20620         }
20621 
20622 
20623         return wm;
20624 
20625     }
20626 
20627 
20628     /**
20629      *  Multiply a p-vector by the transpose of an r-matrix.
20630      *
20631      *<p>This function is derived from the International Astronomical Union's
20632      *  SOFA (Standards Of Fundamental Astronomy) software collection.
20633      *
20634      *<p>Status:  vector/matrix support function.
20635      *
20636      *<!-- Given: -->
20637      *     @param r         double[3][3]    r-matrix
20638      *     @param p         double[3]       p-vector
20639      *
20640      *<!-- Returned: -->
20641      *     @return trp       double[3]        <u>returned</u> r * p
20642      *
20643      *  Note:
20644      *     It is permissible for p and trp to be the same array.
20645      *
20646      *<p>Called:<ul>
20647      *     <li>{@link #jauTr} transpose r-matrix
20648     *     <li>{@link #jauRxp} product of r-matrix and p-vector
20649     * </ul>
20650     *@version 2008 October 28
20651     *
20652     *  @since Release 20101201
20653     *
20654     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20655     */
20656     public static double[] jauTrxp(double r[][], double p[]  )
20657     {
20658        double tr[][];
20659        double trp[];
20660 
20661     /* Transpose of matrix r. */
20662        tr = jauTr(r);
20663 
20664     /* Matrix tr * vector p -> vector trp. */
20665        trp = jauRxp(tr, p);
20666 
20667        return trp;
20668 
20669         }
20670     
20671 
20672     /**
20673     *  Multiply a pv-vector by the transpose of an r-matrix.
20674     *
20675     *<p>This function is derived from the International Astronomical Union's
20676     *  SOFA (Standards Of Fundamental Astronomy) software collection.
20677     *
20678     *<p>Status:  vector/matrix support function.
20679     *
20680     *<!-- Given: -->
20681     *     @param r         double[3][3]     r-matrix
20682     *     @param pv        double[2][3]     pv-vector
20683     *
20684     *<!-- Returned: -->
20685     *     @return trpv      double[2][3]      <u>returned</u> r * pv
20686     *
20687     *  Note:
20688     *     It is permissible for pv and trpv to be the same array.
20689     *
20690     *<p>Called:<ul>
20691     *     <li>{@link #jauTr} transpose r-matrix
20692     *     <li>{@link #jauRxpv} product of r-matrix and pv-vector
20693     * </ul>
20694     *@version 2008 October 28
20695     *
20696     *  @since Release 20101201
20697     *
20698     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
20699     */
20700     public static double[][] jauTrxpv(double r[][], double pv[][] )
20701     {
20702        double tr[][], trpv[][];
20703 
20704 
20705     /* Transpose of matrix r. */
20706        tr = jauTr(r);
20707 
20708     /* Matrix tr * vector pv -> vector trpv. */
20709        trpv = jauRxpv(tr, pv);
20710 
20711        return trpv;
20712 
20713         }
20714     
20715     /*
20716      * constant arrays set outside jauXy06 to avoid problems with 65535 byte limit on function size
20717      */
20718     static {
20719         /* need to define this function because it appears that javac lumps all of the statically defined initalizers into one function on 
20720          * compilation - so this will force a second function */
20721         init_mfals();
20722     }
20723     /** Fundamental-argument multipliers:  luni-solar terms */
20724     private static int mfals[][]; //IMPL would like to be final really
20725     
20726     private static void init_mfals(){
20727         
20728     mfals = new int[][]
20729     {
20730 
20731    /* 1-10 */
20732       {  0,   0,   0,   0,   1 },
20733       {  0,   0,   2,  -2,   2 },
20734       {  0,   0,   2,   0,   2 },
20735       {  0,   0,   0,   0,   2 },
20736       {  0,   1,   0,   0,   0 },
20737       {  0,   1,   2,  -2,   2 },
20738       {  1,   0,   0,   0,   0 },
20739       {  0,   0,   2,   0,   1 },
20740       {  1,   0,   2,   0,   2 },
20741       {  0,   1,  -2,   2,  -2 },
20742 
20743    /* 11-20 */
20744       {  0,   0,   2,  -2,   1 },
20745       {  1,   0,  -2,   0,  -2 },
20746       {  1,   0,   0,  -2,   0 },
20747       {  1,   0,   0,   0,   1 },
20748       {  1,   0,   0,   0,  -1 },
20749       {  1,   0,  -2,  -2,  -2 },
20750       {  1,   0,   2,   0,   1 },
20751       {  2,   0,  -2,   0,  -1 },
20752       {  0,   0,   0,   2,   0 },
20753       {  0,   0,   2,   2,   2 },
20754 
20755    /* 21-30 */
20756       {  2,   0,   0,  -2,   0 },
20757       {  0,   2,  -2,   2,  -2 },
20758       {  2,   0,   2,   0,   2 },
20759       {  1,   0,   2,  -2,   2 },
20760       {  1,   0,  -2,   0,  -1 },
20761       {  2,   0,   0,   0,   0 },
20762       {  0,   0,   2,   0,   0 },
20763       {  0,   1,   0,   0,   1 },
20764       {  1,   0,   0,  -2,  -1 },
20765       {  0,   2,   2,  -2,   2 },
20766 
20767    /* 31-40 */
20768       {  0,   0,   2,  -2,   0 },
20769       {  1,   0,   0,  -2,   1 },
20770       {  0,   1,   0,   0,  -1 },
20771       {  0,   2,   0,   0,   0 },
20772       {  1,   0,  -2,  -2,  -1 },
20773       {  1,   0,   2,   2,   2 },
20774       {  0,   1,   2,   0,   2 },
20775       {  2,   0,  -2,   0,   0 },
20776       {  0,   0,   2,   2,   1 },
20777       {  0,   1,  -2,   0,  -2 },
20778 
20779    /* 41-50 */
20780       {  0,   0,   0,   2,   1 },
20781       {  1,   0,   2,  -2,   1 },
20782       {  2,   0,   0,  -2,  -1 },
20783       {  2,   0,   2,  -2,   2 },
20784       {  2,   0,   2,   0,   1 },
20785       {  0,   0,   0,   2,  -1 },
20786       {  0,   1,  -2,   2,  -1 },
20787       {  1,   1,   0,  -2,   0 },
20788       {  2,   0,   0,  -2,   1 },
20789       {  1,   0,   0,   2,   0 },
20790 
20791    /* 51-60 */
20792       {  0,   1,   2,  -2,   1 },
20793       {  1,  -1,   0,   0,   0 },
20794       {  0,   1,  -1,   1,  -1 },
20795       {  2,   0,  -2,   0,  -2 },
20796       {  0,   1,   0,  -2,   0 },
20797       {  1,   0,   0,  -1,   0 },
20798       {  3,   0,   2,   0,   2 },
20799       {  0,   0,   0,   1,   0 },
20800       {  1,  -1,   2,   0,   2 },
20801       {  1,   1,  -2,  -2,  -2 },
20802 
20803    /* 61-70 */
20804       {  1,   0,  -2,   0,   0 },
20805       {  2,   0,   0,   0,  -1 },
20806       {  0,   1,  -2,  -2,  -2 },
20807       {  1,   1,   2,   0,   2 },
20808       {  2,   0,   0,   0,   1 },
20809       {  1,   1,   0,   0,   0 },
20810       {  1,   0,  -2,   2,  -1 },
20811       {  1,   0,   2,   0,   0 },
20812       {  1,  -1,   0,  -1,   0 },
20813       {  1,   0,   0,   0,   2 },
20814 
20815    /* 71-80 */
20816       {  1,   0,  -1,   0,  -1 },
20817       {  0,   0,   2,   1,   2 },
20818       {  1,   0,  -2,  -4,  -2 },
20819       {  1,  -1,   0,  -1,  -1 },
20820       {  1,   0,   2,   2,   1 },
20821       {  0,   2,  -2,   2,  -1 },
20822       {  1,   0,   0,   0,  -2 },
20823       {  2,   0,  -2,  -2,  -2 },
20824       {  1,   1,   2,  -2,   2 },
20825       {  2,   0,  -2,  -4,  -2 },
20826 
20827    /* 81-90 */
20828       {  1,   0,  -4,   0,  -2 },
20829       {  2,   0,   2,  -2,   1 },
20830       {  1,   0,   0,  -1,  -1 },
20831       {  2,   0,   2,   2,   2 },
20832       {  3,   0,   0,   0,   0 },
20833       {  1,   0,   0,   2,   1 },
20834       {  0,   0,   2,  -2,  -1 },
20835       {  3,   0,   2,  -2,   2 },
20836       {  0,   0,   4,  -2,   2 },
20837       {  1,   0,   0,  -4,   0 },
20838 
20839    /* 91-100 */
20840       {  0,   1,   2,   0,   1 },
20841       {  2,   0,   0,  -4,   0 },
20842       {  1,   1,   0,  -2,  -1 },
20843       {  2,   0,  -2,   0,   1 },
20844       {  0,   0,   2,   0,  -1 },
20845       {  0,   1,  -2,   0,  -1 },
20846       {  0,   1,   0,   0,   2 },
20847       {  0,   0,   2,  -1,   2 },
20848       {  0,   0,   2,   4,   2 },
20849       {  2,   1,   0,  -2,   0 },
20850 
20851    /* 101-110 */
20852       {  1,   1,   0,  -2,   1 },
20853       {  1,  -1,   0,  -2,   0 },
20854       {  1,  -1,   0,  -1,  -2 },
20855       {  1,  -1,   0,   0,   1 },
20856       {  0,   1,  -2,   2,   0 },
20857       {  0,   1,   0,   0,  -2 },
20858       {  1,  -1,   2,   2,   2 },
20859       {  1,   0,   0,   2,  -1 },
20860       {  1,  -1,  -2,  -2,  -2 },
20861       {  3,   0,   2,   0,   1 },
20862 
20863    /* 111-120 */
20864       {  0,   1,   2,   2,   2 },
20865       {  1,   0,   2,  -2,   0 },
20866       {  1,   1,  -2,  -2,  -1 },
20867       {  1,   0,   2,  -4,   1 },
20868       {  0,   1,  -2,  -2,  -1 },
20869       {  2,  -1,   2,   0,   2 },
20870       {  0,   0,   0,   2,   2 },
20871       {  1,  -1,   2,   0,   1 },
20872       {  1,  -1,  -2,   0,  -2 },
20873       {  0,   1,   0,   2,   0 },
20874 
20875    /* 121-130 */
20876       {  0,   1,   2,  -2,   0 },
20877       {  0,   0,   0,   1,   1 },
20878       {  1,   0,  -2,  -2,   0 },
20879       {  0,   3,   2,  -2,   2 },
20880       {  2,   1,   2,   0,   2 },
20881       {  1,   1,   0,   0,   1 },
20882       {  2,   0,   0,   2,   0 },
20883       {  1,   1,   2,   0,   1 },
20884       {  1,   0,   0,  -2,  -2 },
20885       {  1,   0,  -2,   2,   0 },
20886 
20887    /* 131-140 */
20888       {  1,   0,  -1,   0,  -2 },
20889       {  0,   1,   0,  -2,   1 },
20890       {  0,   1,   0,   1,   0 },
20891       {  0,   0,   0,   1,  -1 },
20892       {  1,   0,  -2,   2,  -2 },
20893       {  1,  -1,   0,   0,  -1 },
20894       {  0,   0,   0,   4,   0 },
20895       {  1,  -1,   0,   2,   0 },
20896       {  1,   0,   2,   1,   2 },
20897       {  1,   0,   2,  -1,   2 },
20898 
20899    /* 141-150 */
20900       {  0,   0,   2,   1,   1 },
20901       {  1,   0,   0,  -2,   2 },
20902       {  1,   0,  -2,   0,   1 },
20903       {  1,   0,  -2,  -4,  -1 },
20904       {  0,   0,   2,   2,   0 },
20905       {  1,   1,   2,  -2,   1 },
20906       {  1,   0,  -2,   1,  -1 },
20907       {  0,   0,   1,   0,   1 },
20908       {  2,   0,  -2,  -2,  -1 },
20909       {  4,   0,   2,   0,   2 },
20910 
20911    /* 151-160 */
20912       {  2,  -1,   0,   0,   0 },
20913       {  2,   1,   2,  -2,   2 },
20914       {  0,   1,   2,   1,   2 },
20915       {  1,   0,   4,  -2,   2 },
20916       {  1,   1,   0,   0,  -1 },
20917       {  2,   0,   2,   0,   0 },
20918       {  2,   0,  -2,  -4,  -1 },
20919       {  1,   0,  -1,   0,   0 },
20920       {  1,   0,   0,   1,   0 },
20921       {  0,   1,   0,   2,   1 },
20922 
20923    /* 161-170 */
20924       {  1,   0,  -4,   0,  -1 },
20925       {  1,   0,   0,  -4,  -1 },
20926       {  2,   0,   2,   2,   1 },
20927       {  2,   1,   0,   0,   0 },
20928       {  0,   0,   2,  -3,   2 },
20929       {  1,   2,   0,  -2,   0 },
20930       {  0,   3,   0,   0,   0 },
20931       {  0,   0,   4,   0,   2 },
20932       {  0,   0,   2,  -4,   1 },
20933       {  2,   0,   0,  -2,  -2 },
20934 
20935    /* 171-180 */
20936       {  1,   1,  -2,  -4,  -2 },
20937       {  0,   1,   0,  -2,  -1 },
20938       {  0,   0,   0,   4,   1 },
20939       {  3,   0,   2,  -2,   1 },
20940       {  1,   0,   2,   4,   2 },
20941       {  1,   1,  -2,   0,  -2 },
20942       {  0,   0,   4,  -2,   1 },
20943       {  2,  -2,   0,  -2,   0 },
20944       {  2,   1,   0,  -2,  -1 },
20945       {  0,   2,   0,  -2,   0 },
20946 
20947    /* 181-190 */
20948       {  1,   0,   0,  -1,   1 },
20949       {  1,   1,   2,   2,   2 },
20950       {  3,   0,   0,   0,  -1 },
20951       {  2,   0,   0,  -4,  -1 },
20952       {  3,   0,   2,   2,   2 },
20953       {  0,   0,   2,   4,   1 },
20954       {  0,   2,  -2,  -2,  -2 },
20955       {  1,  -1,   0,  -2,  -1 },
20956       {  0,   0,   2,  -1,   1 },
20957       {  2,   0,   0,   2,   1 },
20958 
20959    /* 191-200 */
20960       {  1,  -1,  -2,   2,  -1 },
20961       {  0,   0,   0,   2,  -2 },
20962       {  2,   0,   0,  -4,   1 },
20963       {  1,   0,   0,  -4,   1 },
20964       {  2,   0,   2,  -4,   1 },
20965       {  4,   0,   2,  -2,   2 },
20966       {  2,   1,  -2,   0,  -1 },
20967       {  2,   1,  -2,  -4,  -2 },
20968       {  3,   0,   0,  -4,   0 },
20969       {  1,  -1,   2,   2,   1 },
20970 
20971    /* 201-210 */
20972       {  1,  -1,  -2,   0,  -1 },
20973       {  0,   2,   0,   0,   1 },
20974       {  1,   2,  -2,  -2,  -2 },
20975       {  1,   1,   0,  -4,   0 },
20976       {  2,   0,   0,  -2,   2 },
20977       {  0,   2,   2,  -2,   1 },
20978       {  1,   0,   2,   0,  -1 },
20979       {  2,   1,   0,  -2,   1 },
20980       {  2,  -1,  -2,   0,  -1 },
20981       {  1,  -1,  -2,  -2,  -1 },
20982 
20983    /* 211-220 */
20984       {  0,   1,  -2,   1,  -2 },
20985       {  1,   0,  -4,   2,  -2 },
20986       {  0,   1,   2,   2,   1 },
20987       {  3,   0,   0,   0,   1 },
20988       {  2,  -1,   2,   2,   2 },
20989       {  0,   1,  -2,  -4,  -2 },
20990       {  1,   0,  -2,  -3,  -2 },
20991       {  2,   0,   0,   0,   2 },
20992       {  1,  -1,   0,  -2,  -2 },
20993       {  2,   0,  -2,   2,  -1 },
20994 
20995    /* 221-230 */
20996       {  0,   2,  -2,   0,  -2 },
20997       {  3,   0,  -2,   0,  -1 },
20998       {  2,  -1,   2,   0,   1 },
20999       {  1,   0,  -2,  -1,  -2 },
21000       {  0,   0,   2,   0,   3 },
21001       {  2,   0,  -4,   0,  -2 },
21002       {  2,   1,   0,  -4,   0 },
21003       {  1,   1,  -2,   1,  -1 },
21004       {  0,   2,   2,   0,   2 },
21005       {  1,  -1,   2,  -2,   2 },
21006 
21007    /* 231-240 */
21008       {  1,  -1,   0,  -2,   1 },
21009       {  2,   1,   2,   0,   1 },
21010       {  1,   0,   2,  -4,   2 },
21011       {  1,   1,  -2,   0,  -1 },
21012       {  1,   1,   0,   2,   0 },
21013       {  1,   0,   0,  -3,   0 },
21014       {  2,   0,   2,  -1,   2 },
21015       {  0,   2,   0,   0,  -1 },
21016       {  2,  -1,   0,  -2,   0 },
21017       {  4,   0,   0,   0,   0 },
21018 
21019    /* 241-250 */
21020       {  2,   1,  -2,  -2,  -2 },
21021       {  0,   2,  -2,   2,   0 },
21022       {  1,   0,   2,   1,   1 },
21023       {  1,   0,  -1,   0,  -3 },
21024       {  3,  -1,   2,   0,   2 },
21025       {  2,   0,   2,  -2,   0 },
21026       {  1,  -2,   0,   0,   0 },
21027       {  2,   0,   0,   0,  -2 },
21028       {  1,   0,   0,   4,   0 },
21029       {  0,   1,   0,   1,   1 },
21030 
21031    /* 251-260 */
21032       {  1,   0,   2,   2,   0 },
21033       {  0,   1,   0,   2,  -1 },
21034       {  0,   1,   0,   1,  -1 },
21035       {  0,   0,   2,  -2,   3 },
21036       {  3,   1,   2,   0,   2 },
21037       {  1,   1,   2,   1,   2 },
21038       {  1,   1,  -2,   2,  -1 },
21039       {  2,  -1,   2,  -2,   2 },
21040       {  1,  -2,   2,   0,   2 },
21041       {  1,   0,   2,  -4,   0 },
21042 
21043    /* 261-270 */
21044       {  0,   0,   1,   0,   0 },
21045       {  1,   0,   2,  -3,   1 },
21046       {  1,  -2,   0,  -2,   0 },
21047       {  2,   0,   0,   2,  -1 },
21048       {  1,   1,   2,  -4,   1 },
21049       {  4,   0,   2,   0,   1 },
21050       {  0,   1,   2,   1,   1 },
21051       {  1,   2,   2,  -2,   2 },
21052       {  2,   0,   2,   1,   2 },
21053       {  2,   1,   2,  -2,   1 },
21054 
21055    /* 271-280 */
21056       {  1,   0,   2,  -1,   1 },
21057       {  1,   0,   4,  -2,   1 },
21058       {  1,  -1,   2,  -2,   1 },
21059       {  0,   1,   0,  -4,   0 },
21060       {  3,   0,  -2,  -2,  -2 },
21061       {  0,   0,   4,  -4,   2 },
21062       {  2,   0,  -4,  -2,  -2 },
21063       {  2,  -2,   0,  -2,  -1 },
21064       {  1,   0,   2,  -2,  -1 },
21065       {  2,   0,  -2,  -6,  -2 },
21066 
21067    /* 281-290 */
21068       {  1,   0,  -2,   1,  -2 },
21069       {  1,   0,  -2,   2,   1 },
21070       {  1,  -1,   0,   2,  -1 },
21071       {  1,   0,  -2,   1,   0 },
21072       {  2,  -1,   0,  -2,   1 },
21073       {  1,  -1,   0,   2,   1 },
21074       {  2,   0,  -2,  -2,   0 },
21075       {  1,   0,   2,  -3,   2 },
21076       {  0,   0,   0,   4,  -1 },
21077       {  2,  -1,   0,   0,   1 },
21078 
21079    /* 291-300 */
21080       {  2,   0,   4,  -2,   2 },
21081       {  0,   0,   2,   3,   2 },
21082       {  0,   1,   4,  -2,   2 },
21083       {  0,   1,  -2,   2,   1 },
21084       {  1,   1,   0,   2,   1 },
21085       {  1,   0,   0,   4,   1 },
21086       {  0,   0,   4,   0,   1 },
21087       {  2,   0,   0,  -3,   0 },
21088       {  1,   0,   0,  -1,  -2 },
21089       {  1,  -2,  -2,  -2,  -2 },
21090 
21091    /* 301-310 */
21092       {  3,   0,   0,   2,   0 },
21093       {  2,   0,   2,  -4,   2 },
21094       {  1,   1,  -2,  -4,  -1 },
21095       {  1,   0,  -2,  -6,  -2 },
21096       {  2,  -1,   0,   0,  -1 },
21097       {  2,  -1,   0,   2,   0 },
21098       {  0,   1,   2,  -2,  -1 },
21099       {  1,   1,   0,   1,   0 },
21100       {  1,   2,   0,  -2,  -1 },
21101       {  1,   0,   0,   1,  -1 },
21102 
21103    /* 311-320 */
21104       {  0,   0,   1,   0,   2 },
21105       {  3,   1,   2,  -2,   2 },
21106       {  1,   0,  -4,  -2,  -2 },
21107       {  1,   0,   2,   4,   1 },
21108       {  1,  -2,   2,   2,   2 },
21109       {  1,  -1,  -2,  -4,  -2 },
21110       {  0,   0,   2,  -4,   2 },
21111       {  0,   0,   2,  -3,   1 },
21112       {  2,   1,  -2,   0,   0 },
21113       {  3,   0,  -2,  -2,  -1 },
21114 
21115    /* 321-330 */
21116       {  2,   0,   2,   4,   2 },
21117       {  0,   0,   0,   0,   3 },
21118       {  2,  -1,  -2,  -2,  -2 },
21119       {  2,   0,   0,  -1,   0 },
21120       {  3,   0,   2,  -4,   2 },
21121       {  2,   1,   2,   2,   2 },
21122       {  0,   0,   3,   0,   3 },
21123       {  1,   1,   2,   2,   1 },
21124       {  2,   1,   0,   0,  -1 },
21125       {  1,   2,   0,  -2,   1 },
21126 
21127    /* 331-340 */
21128       {  3,   0,   2,   2,   1 },
21129       {  1,  -1,  -2,   2,  -2 },
21130       {  1,   1,   0,  -1,   0 },
21131       {  1,   2,   0,   0,   0 },
21132       {  1,   0,   4,   0,   2 },
21133       {  1,  -1,   2,   4,   2 },
21134       {  2,   1,   0,   0,   1 },
21135       {  1,   0,   0,   2,   2 },
21136       {  1,  -1,  -2,   2,   0 },
21137       {  0,   2,  -2,  -2,  -1 },
21138 
21139    /* 341-350 */
21140       {  2,   0,  -2,   0,   2 },
21141       {  5,   0,   2,   0,   2 },
21142       {  3,   0,  -2,  -6,  -2 },
21143       {  1,  -1,   2,  -1,   2 },
21144       {  3,   0,   0,  -4,  -1 },
21145       {  1,   0,   0,   1,   1 },
21146       {  1,   0,  -4,   2,  -1 },
21147       {  0,   1,   2,  -4,   1 },
21148       {  1,   2,   2,   0,   2 },
21149       {  0,   1,   0,  -2,  -2 },
21150 
21151    /* 351-360 */
21152       {  0,   0,   2,  -1,   0 },
21153       {  1,   0,   1,   0,   1 },
21154       {  0,   2,   0,  -2,   1 },
21155       {  3,   0,   2,   0,   0 },
21156       {  1,   1,  -2,   1,   0 },
21157       {  2,   1,  -2,  -4,  -1 },
21158       {  3,  -1,   0,   0,   0 },
21159       {  2,  -1,  -2,   0,   0 },
21160       {  4,   0,   2,  -2,   1 },
21161       {  2,   0,  -2,   2,   0 },
21162 
21163    /* 361-370 */
21164       {  1,   1,   2,  -2,   0 },
21165       {  1,   0,  -2,   4,  -1 },
21166       {  1,   0,  -2,  -2,   1 },
21167       {  2,   0,   2,  -4,   0 },
21168       {  1,   1,   0,  -2,  -2 },
21169       {  1,   1,  -2,  -2,   0 },
21170       {  1,   0,   1,  -2,   1 },
21171       {  2,  -1,  -2,  -4,  -2 },
21172       {  3,   0,  -2,   0,  -2 },
21173       {  0,   1,  -2,  -2,   0 },
21174 
21175    /* 371-380 */
21176       {  3,   0,   0,  -2,  -1 },
21177       {  1,   0,  -2,  -3,  -1 },
21178       {  0,   1,   0,  -4,  -1 },
21179       {  1,  -2,   2,  -2,   1 },
21180       {  0,   1,  -2,   1,  -1 },
21181       {  1,  -1,   0,   0,   2 },
21182       {  2,   0,   0,   1,   0 },
21183       {  1,  -2,   0,   2,   0 },
21184       {  1,   2,  -2,  -2,  -1 },
21185       {  0,   0,   4,  -4,   1 },
21186 
21187    /* 381-390 */
21188       {  0,   1,   2,   4,   2 },
21189       {  0,   1,  -4,   2,  -2 },
21190       {  3,   0,  -2,   0,   0 },
21191       {  2,  -1,   2,   2,   1 },
21192       {  0,   1,  -2,  -4,  -1 },
21193       {  4,   0,   2,   2,   2 },
21194       {  2,   0,  -2,  -3,  -2 },
21195       {  2,   0,   0,  -6,   0 },
21196       {  1,   0,   2,   0,   3 },
21197       {  3,   1,   0,   0,   0 },
21198 
21199    /* 391-400 */
21200       {  3,   0,   0,  -4,   1 },
21201       {  1,  -1,   2,   0,   0 },
21202       {  1,  -1,   0,  -4,   0 },
21203       {  2,   0,  -2,   2,  -2 },
21204       {  1,   1,   0,  -2,   2 },
21205       {  4,   0,   0,  -2,   0 },
21206       {  2,   2,   0,  -2,   0 },
21207       {  0,   1,   2,   0,   0 },
21208       {  1,   1,   0,  -4,   1 },
21209       {  1,   0,   0,  -4,  -2 },
21210 
21211    /* 401-410 */
21212       {  0,   0,   0,   1,   2 },
21213       {  3,   0,   0,   2,   1 },
21214       {  1,   1,   0,  -4,  -1 },
21215       {  0,   0,   2,   2,  -1 },
21216       {  1,   1,   2,   0,   0 },
21217       {  1,  -1,   2,  -4,   1 },
21218       {  1,   1,   0,   0,   2 },
21219       {  0,   0,   2,   6,   2 },
21220       {  4,   0,  -2,  -2,  -1 },
21221       {  2,   1,   0,  -4,  -1 },
21222 
21223    /* 411-420 */
21224       {  0,   0,   0,   3,   1 },
21225       {  1,  -1,  -2,   0,   0 },
21226       {  0,   0,   2,   1,   0 },
21227       {  1,   0,   0,   2,  -2 },
21228       {  3,  -1,   2,   2,   2 },
21229       {  3,  -1,   2,  -2,   2 },
21230       {  1,   0,   0,  -1,   2 },
21231       {  1,  -2,   2,  -2,   2 },
21232       {  0,   1,   0,   2,   2 },
21233       {  0,   1,  -2,  -1,  -2 },
21234 
21235    /* 421-430 */
21236       {  1,   1,  -2,   0,   0 },
21237       {  0,   2,   2,  -2,   0 },
21238       {  3,  -1,  -2,  -1,  -2 },
21239       {  1,   0,   0,  -6,   0 },
21240       {  1,   0,  -2,  -4,   0 },
21241       {  2,   1,   0,  -4,   1 },
21242       {  2,   0,   2,   0,  -1 },
21243       {  2,   0,  -4,   0,  -1 },
21244       {  0,   0,   3,   0,   2 },
21245       {  2,   1,  -2,  -2,  -1 },
21246 
21247    /* 431-440 */
21248       {  1,  -2,   0,   0,   1 },
21249       {  2,  -1,   0,  -4,   0 },
21250       {  0,   0,   0,   3,   0 },
21251       {  5,   0,   2,  -2,   2 },
21252       {  1,   2,  -2,  -4,  -2 },
21253       {  1,   0,   4,  -4,   2 },
21254       {  0,   0,   4,  -1,   2 },
21255       {  3,   1,   0,  -4,   0 },
21256       {  3,   0,   0,  -6,   0 },
21257       {  2,   0,   0,   2,   2 },
21258 
21259    /* 441-450 */
21260       {  2,  -2,   2,   0,   2 },
21261       {  1,   0,   0,  -3,   1 },
21262       {  1,  -2,  -2,   0,  -2 },
21263       {  1,  -1,  -2,  -3,  -2 },
21264       {  0,   0,   2,  -2,  -2 },
21265       {  2,   0,  -2,  -4,   0 },
21266       {  1,   0,  -4,   0,   0 },
21267       {  0,   1,   0,  -1,   0 },
21268       {  4,   0,   0,   0,  -1 },
21269       {  3,   0,   2,  -1,   2 },
21270 
21271    /* 451-460 */
21272       {  3,  -1,   2,   0,   1 },
21273       {  2,   0,   2,  -1,   1 },
21274       {  1,   2,   2,  -2,   1 },
21275       {  1,   1,   0,   2,  -1 },
21276       {  0,   2,   2,   0,   1 },
21277       {  3,   1,   2,   0,   1 },
21278       {  1,   1,   2,   1,   1 },
21279       {  1,   1,   0,  -1,   1 },
21280       {  1,  -2,   0,  -2,  -1 },
21281       {  4,   0,   0,  -4,   0 },
21282 
21283    /* 461-470 */
21284       {  2,   1,   0,   2,   0 },
21285       {  1,  -1,   0,   4,   0 },
21286       {  0,   1,   0,  -2,   2 },
21287       {  0,   0,   2,   0,  -2 },
21288       {  1,   0,  -1,   0,   1 },
21289       {  3,   0,   2,  -2,   0 },
21290       {  2,   0,   2,   2,   0 },
21291       {  1,   2,   0,  -4,   0 },
21292       {  1,  -1,   0,  -3,   0 },
21293       {  0,   1,   0,   4,   0 },
21294 
21295    /* 471 - 480 */
21296       {  0,   1,  -2,   0,   0 },
21297       {  2,   2,   2,  -2,   2 },
21298       {  0,   0,   0,   1,  -2 },
21299       {  0,   2,  -2,   0,  -1 },
21300       {  4,   0,   2,  -4,   2 },
21301       {  2,   0,  -4,   2,  -2 },
21302       {  2,  -1,  -2,   0,  -2 },
21303       {  1,   1,   4,  -2,   2 },
21304       {  1,   1,   2,  -4,   2 },
21305       {  1,   0,   2,   3,   2 },
21306 
21307    /* 481-490 */
21308       {  1,   0,   0,   4,  -1 },
21309       {  0,   0,   0,   4,   2 },
21310       {  2,   0,   0,   4,   0 },
21311       {  1,   1,  -2,   2,   0 },
21312       {  2,   1,   2,   1,   2 },
21313       {  2,   1,   2,  -4,   1 },
21314       {  2,   0,   2,   1,   1 },
21315       {  2,   0,  -4,  -2,  -1 },
21316       {  2,   0,  -2,  -6,  -1 },
21317       {  2,  -1,   2,  -1,   2 },
21318 
21319    /* 491-500 */
21320       {  1,  -2,   2,   0,   1 },
21321       {  1,  -2,   0,  -2,   1 },
21322       {  1,  -1,   0,  -4,  -1 },
21323       {  0,   2,   2,   2,   2 },
21324       {  0,   2,  -2,  -4,  -2 },
21325       {  0,   1,   2,   3,   2 },
21326       {  0,   1,   0,  -4,   1 },
21327       {  3,   0,   0,  -2,   1 },
21328       {  2,   1,  -2,   0,   1 },
21329       {  2,   0,   4,  -2,   1 },
21330 
21331    /* 501-510 */
21332       {  2,   0,   0,  -3,  -1 },
21333       {  2,  -2,   0,  -2,   1 },
21334       {  2,  -1,   2,  -2,   1 },
21335       {  1,   0,   0,  -6,  -1 },
21336       {  1,  -2,   0,   0,  -1 },
21337       {  1,  -2,  -2,  -2,  -1 },
21338       {  0,   1,   4,  -2,   1 },
21339       {  0,   0,   2,   3,   1 },
21340       {  2,  -1,   0,  -1,   0 },
21341       {  1,   3,   0,  -2,   0 },
21342 
21343    /* 511-520 */
21344       {  0,   3,   0,  -2,   0 },
21345       {  2,  -2,   2,  -2,   2 },
21346       {  0,   0,   4,  -2,   0 },
21347       {  4,  -1,   2,   0,   2 },
21348       {  2,   2,  -2,  -4,  -2 },
21349       {  4,   1,   2,   0,   2 },
21350       {  4,  -1,  -2,  -2,  -2 },
21351       {  2,   1,   0,  -2,  -2 },
21352       {  2,   1,  -2,  -6,  -2 },
21353       {  2,   0,   0,  -1,   1 },
21354 
21355    /* 521-530 */
21356       {  2,  -1,  -2,   2,  -1 },
21357       {  1,   1,  -2,   2,  -2 },
21358       {  1,   1,  -2,  -3,  -2 },
21359       {  1,   0,   3,   0,   3 },
21360       {  1,   0,  -2,   1,   1 },
21361       {  1,   0,  -2,   0,   2 },
21362       {  1,  -1,   2,   1,   2 },
21363       {  1,  -1,   0,   0,  -2 },
21364       {  1,  -1,  -4,   2,  -2 },
21365       {  0,   3,  -2,  -2,  -2 },
21366 
21367    /* 531-540 */
21368       {  0,   1,   0,   4,   1 },
21369       {  0,   0,   4,   2,   2 },
21370       {  3,   0,  -2,  -2,   0 },
21371       {  2,  -2,   0,   0,   0 },
21372       {  1,   1,   2,  -4,   0 },
21373       {  1,   1,   0,  -3,   0 },
21374       {  1,   0,   2,  -3,   0 },
21375       {  1,  -1,   2,  -2,   0 },
21376       {  0,   2,   0,   2,   0 },
21377       {  0,   0,   2,   4,   0 },
21378 
21379    /* 541-550 */
21380       {  1,   0,   1,   0,   0 },
21381       {  3,   1,   2,  -2,   1 },
21382       {  3,   0,   4,  -2,   2 },
21383       {  3,   0,   2,   1,   2 },
21384       {  3,   0,   0,   2,  -1 },
21385       {  3,   0,   0,   0,   2 },
21386       {  3,   0,  -2,   2,  -1 },
21387       {  2,   0,   4,  -4,   2 },
21388       {  2,   0,   2,  -3,   2 },
21389       {  2,   0,   0,   4,   1 },
21390 
21391    /* 551-560 */
21392       {  2,   0,   0,  -3,   1 },
21393       {  2,   0,  -4,   2,  -1 },
21394       {  2,   0,  -2,  -2,   1 },
21395       {  2,  -2,   2,   2,   2 },
21396       {  2,  -2,   0,  -2,  -2 },
21397       {  2,  -1,   0,   2,   1 },
21398       {  2,  -1,   0,   2,  -1 },
21399       {  1,   1,   2,   4,   2 },
21400       {  1,   1,   0,   1,   1 },
21401       {  1,   1,   0,   1,  -1 },
21402 
21403    /* 561-570 */
21404       {  1,   1,  -2,  -6,  -2 },
21405       {  1,   0,   0,  -3,  -1 },
21406       {  1,   0,  -4,  -2,  -1 },
21407       {  1,   0,  -2,  -6,  -1 },
21408       {  1,  -2,   2,   2,   1 },
21409       {  1,  -2,  -2,   2,  -1 },
21410       {  1,  -1,  -2,  -4,  -1 },
21411       {  0,   2,   0,   0,   2 },
21412       {  0,   1,   2,  -4,   2 },
21413       {  0,   1,  -2,   4,  -1 },
21414 
21415    /* 571-580 */
21416       {  5,   0,   0,   0,   0 },
21417       {  3,   0,   0,  -3,   0 },
21418       {  2,   2,   0,  -4,   0 },
21419       {  1,  -1,   2,   2,   0 },
21420       {  0,   1,   0,   3,   0 },
21421       {  4,   0,  -2,   0,  -1 },
21422       {  3,   0,  -2,  -6,  -1 },
21423       {  3,   0,  -2,  -1,  -1 },
21424       {  2,   1,   2,   2,   1 },
21425       {  2,   1,   0,   2,   1 },
21426 
21427    /* 581-590 */
21428       {  2,   0,   2,   4,   1 },
21429       {  2,   0,   2,  -6,   1 },
21430       {  2,   0,   2,  -2,  -1 },
21431       {  2,   0,   0,  -6,  -1 },
21432       {  2,  -1,  -2,  -2,  -1 },
21433       {  1,   2,   2,   0,   1 },
21434       {  1,   2,   0,   0,   1 },
21435       {  1,   0,   4,   0,   1 },
21436       {  1,   0,   2,  -6,   1 },
21437       {  1,   0,   2,  -4,  -1 },
21438 
21439    /* 591-600 */
21440       {  1,   0,  -1,  -2,  -1 },
21441       {  1,  -1,   2,   4,   1 },
21442       {  1,  -1,   2,  -3,   1 },
21443       {  1,  -1,   0,   4,   1 },
21444       {  1,  -1,  -2,   1,  -1 },
21445       {  0,   1,   2,  -2,   3 },
21446       {  3,   0,   0,  -2,   0 },
21447       {  1,   0,   1,  -2,   0 },
21448       {  0,   2,   0,  -4,   0 },
21449       {  0,   0,   2,  -4,   0 },
21450 
21451    /* 601-610 */
21452       {  0,   0,   1,  -1,   0 },
21453       {  0,   0,   0,   6,   0 },
21454       {  0,   2,   0,   0,  -2 },
21455       {  0,   1,  -2,   2,  -3 },
21456       {  4,   0,   0,   2,   0 },
21457       {  3,   0,   0,  -1,   0 },
21458       {  3,  -1,   0,   2,   0 },
21459       {  2,   1,   0,   1,   0 },
21460       {  2,   1,   0,  -6,   0 },
21461       {  2,  -1,   2,   0,   0 },
21462 
21463    /* 611-620 */
21464       {  1,   0,   2,  -1,   0 },
21465       {  1,  -1,   0,   1,   0 },
21466       {  1,  -1,  -2,  -2,   0 },
21467       {  0,   1,   2,   2,   0 },
21468       {  0,   0,   2,  -3,   0 },
21469       {  2,   2,   0,  -2,  -1 },
21470       {  2,  -1,  -2,   0,   1 },
21471       {  1,   2,   2,  -4,   1 },
21472       {  0,   1,   4,  -4,   2 },
21473       {  0,   0,   0,   3,   2 },
21474 
21475    /* 621-630 */
21476       {  5,   0,   2,   0,   1 },
21477       {  4,   1,   2,  -2,   2 },
21478       {  4,   0,  -2,  -2,   0 },
21479       {  3,   1,   2,   2,   2 },
21480       {  3,   1,   0,  -2,   0 },
21481       {  3,   1,  -2,  -6,  -2 },
21482       {  3,   0,   0,   0,  -2 },
21483       {  3,   0,  -2,  -4,  -2 },
21484       {  3,  -1,   0,  -3,   0 },
21485       {  3,  -1,   0,  -2,   0 },
21486 
21487    /* 631-640 */
21488       {  2,   1,   2,   0,   0 },
21489       {  2,   1,   2,  -4,   2 },
21490       {  2,   1,   2,  -2,   0 },
21491       {  2,   1,   0,  -3,   0 },
21492       {  2,   1,  -2,   0,  -2 },
21493       {  2,   0,   0,  -4,   2 },
21494       {  2,   0,   0,  -4,  -2 },
21495       {  2,   0,  -2,  -5,  -2 },
21496       {  2,  -1,   2,   4,   2 },
21497       {  2,  -1,   0,  -2,   2 },
21498 
21499    /* 641-650 */
21500       {  1,   3,  -2,  -2,  -2 },
21501       {  1,   1,   0,   0,  -2 },
21502       {  1,   1,   0,  -6,   0 },
21503       {  1,   1,  -2,   1,  -2 },
21504       {  1,   1,  -2,  -1,  -2 },
21505       {  1,   0,   2,   1,   0 },
21506       {  1,   0,   0,   3,   0 },
21507       {  1,   0,   0,  -4,   2 },
21508       {  1,   0,  -2,   4,  -2 },
21509       {  1,  -2,   0,  -1,   0 },
21510 
21511    /* 651-NFLS */
21512       {  0,   1,  -4,   2,  -1 },
21513       {  1,   0,  -2,   0,  -3 },
21514       {  0,   0,   4,  -4,   4 }
21515    };
21516     }
21517 
21518 
21519     /* Fundamental-argument multipliers:  planetary terms */
21520       private static final int mfapl[][] = {
21521 
21522        /* 1-10 */
21523           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21524           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -1 },
21525           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -2 },
21526           {  0,  0,  1, -1,  1,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21527           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  2 },
21528           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21529           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21530           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  0 },
21531           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21532           {  0,  0,  0,  0,  1,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
21533 
21534        /* 11-20 */
21535           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -1 },
21536           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2, -5,  0,  0,  0 },
21537           {  0,  0,  2, -2,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21538           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -2 },
21539           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -1,  0,  0,  0,  2 },
21540           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  3,  0,  0,  0, -2 },
21541           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -2 },
21542           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  3,  0,  0,  0,  2 },
21543           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21544           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21545 
21546        /* 21-30 */
21547           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
21548           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  2 },
21549           {  0,  0,  0,  0,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21550           {  0,  0,  0,  0,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21551           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21552           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  2 },
21553           {  0,  0,  1, -1,  1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21554           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21555           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  1 },
21556           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21557 
21558        /* 31-40 */
21559           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
21560           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21561           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  2 },
21562           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -2 },
21563           {  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
21564           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  1 },
21565           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21566           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21567           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
21568           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21569 
21570        /* 41-50 */
21571           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
21572           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -2 },
21573           {  0,  0,  1, -1,  0,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21574           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -2,  0,  0,  0,  2 },
21575           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0, -2 },
21576           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21577           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  2 },
21578           {  1,  0,  0,  0,  0,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21579           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21580           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  1,  0,  0,  0,  2 },
21581 
21582        /* 51-60 */
21583           {  0,  0,  1, -1,  1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21584           {  1,  0,  0,  0,  0,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
21585           {  0,  0,  2, -2,  0,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21586           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  2 },
21587           {  1,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21588           {  0,  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  2 },
21589           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1 },
21590           {  1,  0, -2,  0, -2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21591           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21592           {  0,  0,  2, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21593 
21594        /* 61-70 */
21595           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  2 },
21596           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0, -2 },
21597           {  0,  0,  1, -1,  1,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21598           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -2 },
21599           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  2 },
21600           {  0,  0,  0,  0,  0,  0,  0,  8,-16,  4,  5,  0,  0,  2 },
21601           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -1 },
21602           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0, -1 },
21603           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -2 },
21604           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21605 
21606        /* 71-80 */
21607           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -2 },
21608           {  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0,  2 },
21609           {  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0, -2 },
21610           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -2 },
21611           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -2 },
21612           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  2 },
21613           {  0,  0,  1, -1,  1,  0,  0, -5,  8, -3,  0,  0,  0,  0 },
21614           {  0,  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  2 },
21615           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  2 },
21616           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
21617 
21618        /* 81-90 */
21619           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21620           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0, -1 },
21621           {  2,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21622           {  0,  0,  0,  0,  1,  0,  8,-13,  0,  0,  0,  0,  0,  0 },
21623           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -2,  5,  0,  0,  0 },
21624           {  1,  0,  0, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21625           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  2 },
21626           {  1,  0,  0,  0, -1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21627           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  2, -5,  0,  0,  0 },
21628           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
21629 
21630        /* 91-100 */
21631           {  1,  0,  0, -2,  0,  0, 19,-21,  3,  0,  0,  0,  0,  0 },
21632           {  0,  0,  0,  0,  1,  0, -8, 13,  0,  0,  0,  0,  0,  0 },
21633           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
21634           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -2 },
21635           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  2 },
21636           {  1,  0,  0,  0,  1,  0,-18, 16,  0,  0,  0,  0,  0,  0 },
21637           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0, -1 },
21638           {  0,  0,  0,  0,  0,  0,  0,  6,-16,  4,  5,  0,  0, -2 },
21639           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -2 },
21640           {  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0, -2 },
21641 
21642        /* 101-110 */
21643           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0, -1 },
21644           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  1 },
21645           {  2,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21646           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, -1 },
21647           {  0,  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0 },
21648           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
21649           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21650           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  0 },
21651           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0 },
21652           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2,  0,  0,  0,  2 },
21653 
21654        /* 111-120 */
21655           {  0,  0,  0,  0,  1,  0,  0,  1, -2,  0,  0,  0,  0,  0 },
21656           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  2 },
21657           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21658           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21659           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0, -1 },
21660           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  2 },
21661           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  0 },
21662           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
21663           {  2,  0,  0, -2,  0,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21664           {  0,  0,  1, -1,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21665 
21666        /* 121-130 */
21667           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1 },
21668           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21669           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0, -1 },
21670           {  0,  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0 },
21671           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -2 },
21672           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1,  0,  0,  0 },
21673           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -2 },
21674           {  0,  0,  1, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21675           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -2 },
21676           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21677 
21678        /* 131-140 */
21679           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0, -1 },
21680           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  0 },
21681           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -1 },
21682           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0, -1 },
21683           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21684           {  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  2 },
21685           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -3,  0,  0,  0,  2 },
21686           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  1 },
21687           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  1 },
21688           {  0,  0,  0,  0,  1,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
21689 
21690        /* 141-150 */
21691           {  1,  0,  0, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21692           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0, -1 },
21693           {  0,  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  2 },
21694           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  2 },
21695           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -2 },
21696           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -1 },
21697           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21698           {  0,  0,  1, -1,  1,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
21699           {  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0,  0 },
21700           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -1,  0,  0,  0,  2 },
21701 
21702        /* 151-160 */
21703           {  1,  0,  0, -1,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21704           {  0,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21705           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -4, 10,  0,  0,  0 },
21706           {  0,  0,  0,  0,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21707           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
21708           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0,  0 },
21709           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  2 },
21710           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0, -2 },
21711           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0, -2 },
21712           {  0,  0,  2, -2,  1,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
21713 
21714        /* 161-170 */
21715           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -1,  0,  0,  2 },
21716           {  0,  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  2 },
21717           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  2,  0 },
21718           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0, -1 },
21719           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0, -1 },
21720           {  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
21721           {  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  1 },
21722           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  1,  0,  0,  0 },
21723           {  0,  0,  2, -2,  1,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
21724           {  2,  0,  2,  0,  2,  0,  0,  2,  0, -3,  0,  0,  0,  0 },
21725 
21726        /* 171-180 */
21727           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -2 },
21728           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21729           {  1,  0,  0, -1, -1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
21730           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -2 },
21731           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  0 },
21732           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  1 },
21733           {  1,  0,  2,  0,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21734           {  1,  0, -2,  0, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
21735           {  0,  0,  0,  0,  1,  0,  0, -2,  4,  0,  0,  0,  0,  0 },
21736           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0 },
21737 
21738        /* 181-190 */
21739           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  2 },
21740           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  1 },
21741           {  0,  0,  2,  0,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21742           {  0,  0,  0,  0,  0,  0,  0,  1, -8,  3,  0,  0,  0, -2 },
21743           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -2 },
21744           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  3,  0,  0,  0,  2 },
21745           {  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
21746           {  0,  0,  1, -1,  1,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
21747           {  0,  0,  1, -1,  0,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
21748           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  1 },
21749 
21750        /* 191-200 */
21751           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -1,  0,  0,  0,  0 },
21752           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -2 },
21753           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21754           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0 },
21755           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  2, -5,  0,  0,  0 },
21756           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0, -1 },
21757           {  0,  0,  1, -1,  1,  0,  0, -9, 15,  0,  0,  0,  0,  0 },
21758           {  0,  0,  0,  0,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21759           {  0,  0,  0,  0,  1,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
21760           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0 },
21761 
21762        /* 201-210 */
21763           {  0,  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0, -2 },
21764           {  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  2 },
21765           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -1,  0,  0,  2 },
21766           {  2,  0,  0, -2,  1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21767           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0, -1 },
21768           {  0,  0,  1, -1,  1,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
21769           {  0,  0,  1, -1,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21770           {  0,  0,  1, -1,  1,  0,  8,-14,  0,  0,  0,  0,  0,  0 },
21771           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  0 },
21772           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21773 
21774        /* 211-220 */
21775           {  0,  0,  0,  0,  1,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
21776           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0,  0 },
21777           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0,  0 },
21778           {  2,  0,  0, -2,  1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21779           {  0,  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  2 },
21780           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  1,  0,  0,  2 },
21781           {  2,  0, -1, -1,  0,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
21782           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -2 },
21783           {  0,  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0 },
21784           {  0,  0,  1, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21785 
21786        /* 221-230 */
21787           {  2,  0,  0, -2,  0,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
21788           {  2,  0,  0, -2,  0,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
21789           {  0,  0,  0,  0,  1,  0,  0,  0,  0, -1,  0,  0,  0,  0 },
21790           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  1 },
21791           {  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  0,  1 },
21792           {  0,  0,  0,  0,  0,  0,  1,  2,  0,  0,  0,  0,  0,  2 },
21793           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21794           {  0,  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0 },
21795           {  0,  0,  0,  0,  0,  0,  3, -9,  4,  0,  0,  0,  0, -2 },
21796           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -2 },
21797 
21798        /* 231-240 */
21799           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0, -2 },
21800           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  1 },
21801           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -2 },
21802           {  0,  0,  0,  0,  0,  0,  3, -5,  4,  0,  0,  0,  0,  2 },
21803           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21804           {  2,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21805           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -2 },
21806           {  0,  0,  1, -1,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
21807           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  2 },
21808           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0, -1 },
21809 
21810        /* 241-250 */
21811           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  1,  0,  0,  0 },
21812           {  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0,  0,  0,  1 },
21813           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0 },
21814           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0,  0 },
21815           {  0,  0,  1, -1,  1,  0,  2, -4,  0, -3,  0,  0,  0,  0 },
21816           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
21817           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  2 },
21818           {  0,  0,  2, -2,  2,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
21819           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  0 },
21820           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -2,  0,  0,  0 },
21821 
21822        /* 251-260 */
21823           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  1,  0,  0,  2 },
21824           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -2 },
21825           {  0,  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  2 },
21826           {  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  0, -1 },
21827           {  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0,  0, -1 },
21828           {  0,  0,  0,  0,  0,  0,  2, -1,  0,  0,  0,  0,  0,  0 },
21829           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21830           {  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  2 },
21831           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  5,  0,  0,  2 },
21832           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  0,  0,  0,  0,  1 },
21833 
21834        /* 261-270 */
21835           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  2 },
21836           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2, -5,  0,  0,  2 },
21837           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
21838           {  2,  0,  0, -2, -1,  0, -6,  8,  0,  0,  0,  0,  0,  0 },
21839           {  1,  0,  0, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21840           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0,  0 },
21841           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  2, -5,  0,  0,  2 },
21842           {  0,  0,  0,  0,  1,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
21843           {  0,  0,  2, -2,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
21844           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21845 
21846        /* 271-280 */
21847           {  0,  0,  1, -1,  0,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
21848           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -3,  0,  0,  0,  0 },
21849           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  1 },
21850           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0, -2 },
21851           {  0,  0,  0,  0,  0,  0,  0, 11,  0,  0,  0,  0,  0,  2 },
21852           {  0,  0,  0,  0,  0,  0,  0,  6,-15,  0,  0,  0,  0, -2 },
21853           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  1,  0,  0,  0,  2 },
21854           {  1,  0,  0, -1,  0,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
21855           {  0,  0,  0,  0,  1,  0, -3,  7, -4,  0,  0,  0,  0,  0 },
21856           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -2,  0,  0,  0,  2 },
21857 
21858        /* 281-290 */
21859           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0,  0,  1 },
21860           {  0,  0,  2, -2,  2,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21861           {  0,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21862           {  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  0,  2 },
21863           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  0 },
21864           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  2 },
21865           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0, -2 },
21866           {  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0 },
21867           {  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0,  0 },
21868           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0, -2 },
21869 
21870        /* 291-300 */
21871           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0, -2 },
21872           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21873           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21874           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0,  1 },
21875           {  0,  0,  0,  0,  0,  0,  9,-12,  0,  0,  0,  0,  0, -2 },
21876           {  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0,  1 },
21877           {  0,  0,  1, -1,  0,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
21878           {  0,  0,  1, -1,  1,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
21879           {  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  0, -1 },
21880           {  0,  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0, -1 },
21881 
21882        /* 301-310 */
21883           {  0,  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  2 },
21884           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0, -2 },
21885           {  0,  0,  1, -1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
21886           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0, -1 },
21887           {  0,  0,  1, -1, -1,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21888           {  0,  0,  0,  0,  0,  0,  0,  1, -5,  0,  0,  0,  0, -2 },
21889           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
21890           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  0 },
21891           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
21892           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  2 },
21893 
21894        /* 311-320 */
21895           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0, -1 },
21896           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  3,  0,  0,  0 },
21897           {  0,  0,  0,  0,  1,  0,  0,  2, -4,  0,  0,  0,  0,  0 },
21898           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  2 },
21899           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  1 },
21900           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21901           {  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0,  0, -2 },
21902           {  0,  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  2 },
21903           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  2 },
21904           {  0,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21905 
21906        /* 321-330 */
21907           {  0,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21908           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -3,  0,  0,  0,  2 },
21909           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  0 },
21910           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
21911           {  0,  0,  0,  0,  0,  0,  4, -3,  0,  0,  0,  0,  0,  2 },
21912           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  2 },
21913           {  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0,  0, -2 },
21914           {  0,  0,  0,  0,  0,  0,  8,-13,  0,  0,  0,  0,  0,  1 },
21915           {  0,  0,  2, -2,  1, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
21916           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  2,  0,  0 },
21917 
21918        /* 331-340 */
21919           {  0,  0,  0,  0,  1,  0,  3, -5,  0,  0,  0,  0,  0,  0 },
21920           {  1,  0,  0, -2,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21921           {  0,  0,  2, -2,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21922           {  0,  0,  0,  0,  0,  0,  9, -9,  0,  0,  0,  0,  0,  0 },
21923           {  0,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
21924           {  0,  0,  2, -2,  1,  0,  0, -8, 11,  0,  0,  0,  0,  0 },
21925           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
21926           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -1,  2,  0,  0,  0 },
21927           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  2 },
21928           {  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0,  0, -2 },
21929 
21930        /* 341-350 */
21931           {  0,  0,  0,  0,  0,  0,  0,  8,-15,  0,  0,  0,  0, -1 },
21932           {  0,  0,  0,  0,  0,  0,  0,  5, -2,  0,  0,  0,  0,  2 },
21933           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2 },
21934           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0, -2 },
21935           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -2,  0,  0,  0,  0 },
21936           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  3,  0,  0,  0,  2 },
21937           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
21938           {  0,  0,  0,  0,  0,  0,  8, -8,  0,  0,  0,  0,  0, -1 },
21939           {  0,  0,  0,  0,  0,  0,  8,-10,  0,  0,  0,  0,  0, -1 },
21940           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  1 },
21941 
21942        /* 351-360 */
21943           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0, -1 },
21944           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -1 },
21945           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  2 },
21946           {  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0,  2 },
21947           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -4,  0,  0,  0,  0 },
21948           {  2,  0,  0, -2, -1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
21949           {  0,  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0, -2 },
21950           {  2,  0, -1, -1, -1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
21951           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0,  0 },
21952           {  0,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
21953 
21954        /* 361-370 */
21955           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  4, -3,  0,  0,  0 },
21956           {  0,  0,  0,  0,  0,  0,  0,  6,-11,  0,  0,  0,  0,  0 },
21957           {  2,  0,  0, -2,  1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
21958           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0, -2 },
21959           {  0,  0,  0,  0,  0,  0,  0,  6, -5,  0,  0,  0,  0,  2 },
21960           {  1,  0, -2, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21961           {  0,  0,  1, -1,  2,  0,  0,  0, -2,  0,  0,  0,  0,  0 },
21962           {  0,  0,  0,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
21963           {  0,  0,  0,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
21964           {  0,  0,  0,  0,  0,  0,  0,  6,  0,  0,  0,  0,  0,  1 },
21965 
21966        /* 371-380 */
21967           {  0,  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  2 },
21968           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0, -2,  0,  0,  2 },
21969           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0, -2,  0,  0,  2 },
21970           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  1 },
21971           {  0,  0,  0,  0,  0,  0,  0,  1, -6,  0,  0,  0,  0, -2 },
21972           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  2 },
21973           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  2 },
21974           {  0,  0,  0,  0,  0,  0,  3, -5,  0,  2,  0,  0,  0,  0 },
21975           {  0,  0,  0,  0,  0,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
21976           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -2,  0,  0,  0,  2 },
21977 
21978        /* 381-390 */
21979           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  2,  0,  0,  0 },
21980           {  0,  0,  0,  0,  1,  0,  0, -8, 15,  0,  0,  0,  0,  0 },
21981           {  2,  0,  0, -2, -2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
21982           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21983           {  1,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
21984           {  1,  0, -1,  1, -1,  0,-18, 17,  0,  0,  0,  0,  0,  0 },
21985           {  0,  0,  2,  0,  2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
21986           {  0,  0,  2,  0,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21987           {  0,  0,  2, -2, -1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
21988           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
21989 
21990        /* 391-400 */
21991           {  0,  0,  0,  0,  1,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
21992           {  0,  0,  0,  0,  0,  0,  8,-16,  0,  0,  0,  0,  0, -2 },
21993           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  5,  0,  0,  2 },
21994           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  2 },
21995           {  0,  0,  0,  0,  2,  0,  0, -1,  2,  0,  0,  0,  0,  0 },
21996           {  2,  0, -1, -1, -2,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
21997           {  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0, -1 },
21998           {  0,  0,  1, -1,  1,  0,  0, -1,  0, -2,  4,  0,  0,  0 },
21999           {  0,  0,  0,  0,  0,  0,  0,  2,  2,  0,  0,  0,  0,  2 },
22000           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  4, -5,  0,  0,  0 },
22001 
22002        /* 401-410 */
22003           {  2,  0,  0, -2, -1,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22004           {  2,  0, -1, -1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
22005           {  1,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0,  0,  0,  0 },
22006           {  1,  0,  0, -1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22007           {  1,  0, -1, -1, -1,  0, 20,-20,  0,  0,  0,  0,  0,  0 },
22008           {  0,  0,  2, -2,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22009           {  0,  0,  1, -1,  1,  0,  1, -2,  0,  0,  0,  0,  0,  0 },
22010           {  0,  0,  1, -1,  1,  0, -2,  1,  0,  0,  0,  0,  0,  0 },
22011           {  0,  0,  0,  0,  1,  0,  5, -8,  0,  0,  0,  0,  0,  0 },
22012           {  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1,  0,  0,  0 },
22013 
22014        /* 411-420 */
22015           {  0,  0,  0,  0,  0,  0,  9,-11,  0,  0,  0,  0,  0, -1 },
22016           {  0,  0,  0,  0,  0,  0,  5, -3,  0,  0,  0,  0,  0,  1 },
22017           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  0,  0,  0, -1 },
22018           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  1 },
22019           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0,  0 },
22020           {  0,  0,  0,  0,  0,  0,  0,  3, -2,  0,  0,  0,  0,  0 },
22021           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -2 },
22022           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22023           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -2,  5,  0,  0,  0 },
22024           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0,  0 },
22025 
22026        /* 421-430 */
22027           {  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22028           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  0,  0,  0,  0, -2 },
22029           {  0,  0,  0,  0,  0,  0,  0,  2, -6,  0,  0,  0,  0, -2 },
22030           {  1,  0,  0, -2,  0,  0, 20,-21,  0,  0,  0,  0,  0,  0 },
22031           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0,  0 },
22032           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0,  0 },
22033           {  0,  0,  0,  0,  0,  0,  0,  4, -4,  0,  0,  0,  0,  0 },
22034           {  0,  0,  1, -1,  2,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22035           {  0,  0,  0,  0,  0,  0,  8,-12,  0,  0,  0,  0,  0, -2 },
22036           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0,  0 },
22037 
22038        /* 431-440 */
22039           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  2 },
22040           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  1,  5,  0,  0,  2 },
22041           {  0,  0,  0,  0,  0,  0,  0,  4, -6,  0,  0,  0,  0, -2 },
22042           {  0,  0,  0,  0,  0,  0,  0,  2, -7,  0,  0,  0,  0, -2 },
22043           {  1,  0,  0, -1,  1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22044           {  1,  0, -2,  0, -2,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22045           {  0,  0,  0,  0,  1,  0,  0, -9, 17,  0,  0,  0,  0,  0 },
22046           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -2 },
22047           {  1,  0, -2, -2, -2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22048           {  1,  0, -1,  1, -1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22049 
22050        /* 441-450 */
22051           {  0,  0,  2, -2,  2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22052           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22053           {  0,  0,  1, -1,  2,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22054           {  0,  0,  0,  0,  1,  0,  0,  2, -2,  0,  0,  0,  0,  0 },
22055           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -1 },
22056           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0, -2 },
22057           {  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  0,  0 },
22058           {  0,  0,  0,  0,  0,  0,  0,  5,-10,  0,  0,  0,  0, -2 },
22059           {  0,  0,  0,  0,  0,  0,  0,  4,  0, -4,  0,  0,  0,  2 },
22060           {  0,  0,  0,  0,  0,  0,  0,  2,  0, -5,  0,  0,  0, -2 },
22061 
22062        /* 451-460 */
22063           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -5,  0,  0,  0, -2 },
22064           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  5,  0,  0,  2 },
22065           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -2,  0,  0,  0, -2 },
22066           {  0,  0,  0,  0,  0,  0,  2, -3,  0,  0,  0,  0,  0,  1 },
22067           {  1,  0,  0, -2,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22068           {  0,  0,  0,  0,  0,  0,  3, -7,  4,  0,  0,  0,  0,  0 },
22069           {  2,  0,  2,  0,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22070           {  0,  0,  1, -1, -1,  0,  0, -1,  0, -1,  0,  0,  0,  0 },
22071           {  0,  0,  0,  0,  1,  0,  0,  1,  0, -2,  0,  0,  0,  0 },
22072           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0, -2 },
22073 
22074        /* 461-470 */
22075           {  1,  0,  0, -1,  1,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22076           {  0,  0,  2, -2,  1,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22077           {  0,  0,  2, -2,  1,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22078           {  0,  0,  2, -2,  1,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22079           {  0,  0,  2, -2,  1,  0,  0, -3,  0,  3,  0,  0,  0,  0 },
22080           {  0,  0,  2, -2,  1,  0, -5,  5,  0,  0,  0,  0,  0,  0 },
22081           {  0,  0,  1, -1,  1,  0,  1, -3,  0,  0,  0,  0,  0,  0 },
22082           {  0,  0,  1, -1,  1,  0,  0, -4,  6,  0,  0,  0,  0,  0 },
22083           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  0,  0, -1,  0,  0 },
22084           {  0,  0,  1, -1,  1,  0, -5,  6,  0,  0,  0,  0,  0,  0 },
22085 
22086        /* 471-480 */
22087           {  0,  0,  0,  0,  1,  0,  3, -4,  0,  0,  0,  0,  0,  0 },
22088           {  0,  0,  0,  0,  1,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22089           {  0,  0,  0,  0,  0,  0,  7,-10,  0,  0,  0,  0,  0, -1 },
22090           {  0,  0,  0,  0,  0,  0,  5, -5,  0,  0,  0,  0,  0,  1 },
22091           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0, -2 },
22092           {  0,  0,  0,  0,  0,  0,  3, -8,  0,  0,  0,  0,  0, -2 },
22093           {  0,  0,  0,  0,  0,  0,  2, -5,  0,  0,  0,  0,  0, -1 },
22094           {  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0,  0,  0, -1 },
22095           {  0,  0,  0,  0,  0,  0,  0,  7, -9,  0,  0,  0,  0,  2 },
22096           {  0,  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  2 },
22097 
22098        /* 481-490 */
22099           {  0,  0,  0,  0,  0,  0,  0,  3,  0,  0,  0,  0,  0,  2 },
22100           {  0,  0,  0,  0,  0,  0,  0,  3, -8,  3,  0,  0,  0, -2 },
22101           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -2,  0,  0,  1 },
22102           {  0,  0,  0,  0,  0,  0,  0,  2, -4,  0,  0,  0,  0,  1 },
22103           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0, -1 },
22104           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0, -1 },
22105           {  2,  0,  0, -2, -1,  0,  0, -6,  8,  0,  0,  0,  0,  0 },
22106           {  2,  0, -1, -1,  1,  0,  0,  3, -7,  0,  0,  0,  0,  0 },
22107           {  0,  0,  2, -2,  1,  0,  0, -7,  9,  0,  0,  0,  0,  0 },
22108           {  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0,  0, -1 },
22109 
22110        /* 491-500 */
22111           {  0,  0,  1, -1,  2,  0, -8, 12,  0,  0,  0,  0,  0,  0 },
22112           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22113           {  1,  0,  0, -2,  0,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22114           {  0,  0,  0,  0,  0,  0,  7, -8,  0,  0,  0,  0,  0,  0 },
22115           {  0,  0,  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0 },
22116           {  2,  0,  0, -2,  1,  0,  0, -5,  6,  0,  0,  0,  0,  0 },
22117           {  2,  0,  0, -2, -1,  0,  0, -2,  0,  3, -1,  0,  0,  0 },
22118           {  1,  0,  1,  1,  1,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22119           {  1,  0,  0, -2,  1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22120           {  1,  0,  0, -2, -1,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22121 
22122        /* 501-510 */
22123           {  1,  0,  0, -1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0 },
22124           {  1,  0, -1,  0, -1,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22125           {  0,  0,  2, -2,  1,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22126           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  0,  0,  0,  0,  0 },
22127           {  0,  0,  2, -2,  1,  0, -8, 11,  0,  0,  0,  0,  0,  0 },
22128           {  0,  0,  2, -2,  0,  0,  0, -9, 13,  0,  0,  0,  0,  0 },
22129           {  0,  0,  1,  1,  2,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22130           {  0,  0,  1, -1,  1,  0,  0,  1, -4,  0,  0,  0,  0,  0 },
22131           {  0,  0,  1, -1,  1,  0,  0, -1,  0,  1, -3,  0,  0,  0 },
22132           {  0,  0,  0,  0,  1,  0,  0,  7,-13,  0,  0,  0,  0,  0 },
22133 
22134        /* 511-520 */
22135           {  0,  0,  0,  0,  1,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22136           {  0,  0,  0,  0,  1,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22137           {  0,  0,  0,  0,  1,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22138           {  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0,  0,  0 },
22139           {  0,  0,  0,  0,  0,  0,  7,-11,  0,  0,  0,  0,  0, -1 },
22140           {  0,  0,  0,  0,  0,  0,  6, -6,  0,  0,  0,  0,  0,  1 },
22141           {  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  0,  1 },
22142           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -1 },
22143           {  0,  0,  0,  0,  0,  0,  4, -2,  0,  0,  0,  0,  0,  0 },
22144           {  0,  0,  0,  0,  0,  0,  3, -4,  0,  0,  0,  0,  0,  1 },
22145 
22146        /* 521-530 */
22147           {  0,  0,  0,  0,  0,  0,  1, -4,  0,  0,  0,  0,  0, -1 },
22148           {  0,  0,  0,  0,  0,  0,  0,  9,-17,  0,  0,  0,  0, -2 },
22149           {  0,  0,  0,  0,  0,  0,  0,  7, -7,  0,  0,  0,  0,  2 },
22150           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  1 },
22151           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0, -1 },
22152           {  0,  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0 },
22153           {  0,  0,  0,  0,  0,  0,  0,  4, -7,  0,  0,  0,  0, -1 },
22154           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1,  0,  0,  0,  1 },
22155           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -4,  0,  0,  0,  0 },
22156           {  2,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22157 
22158        /* 531-540 */
22159           {  2,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22160           {  1,  0,  0,  0,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22161           {  1,  0,  0,  0,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22162           {  1,  0,  0,  0,  0,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22163           {  1,  0,  0, -2,  0,  0, 17,-16,  0, -2,  0,  0,  0,  0 },
22164           {  1,  0,  0, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22165           {  0,  0,  2, -2,  0,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22166           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0 },
22167           {  0,  0,  0,  0,  0,  0,  0,  4,  0,  0,  0,  0,  0,  0 },
22168           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -4,  0,  0,  0,  0 },
22169 
22170        /* 541-550 */
22171           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2, -2 },
22172           {  0,  0,  0,  0,  0,  0,  0,  2,  1,  0,  0,  0,  0,  2 },
22173           {  2,  0,  0, -2,  0,  0,  0, -4,  4,  0,  0,  0,  0,  0 },
22174           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  2,  2,  0,  0,  0 },
22175           {  1,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22176           {  1,  0,  0,  0,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22177           {  1,  0,  0,  0,  0,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22178           {  1,  0,  0, -2,  0,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22179           {  1,  0,  0, -2,  0,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22180           {  1,  0,  0, -2,  0,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22181 
22182        /* 551-560 */
22183           {  1,  0,  0, -2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22184           {  0,  0,  2, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22185           {  0,  0,  1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22186           {  0,  0,  1, -1,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22187           {  0,  0,  1, -1,  0,  0,  0, -2,  2,  0,  0,  0,  0,  0 },
22188           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22189           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0,  1,  0,  0,  0 },
22190           {  0,  0,  1, -1,  0,  0, -4,  5,  0,  0,  0,  0,  0,  0 },
22191           {  0,  0,  1, -1,  0,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22192           {  0,  0,  0,  2,  0,  0,  0, -1,  0,  1,  0,  0,  0,  0 },
22193 
22194        /* 561-570 */
22195           {  0,  0,  0,  0,  0,  0,  8, -9,  0,  0,  0,  0,  0,  0 },
22196           {  0,  0,  0,  0,  0,  0,  3, -6,  0,  0,  0,  0,  0,  0 },
22197           {  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0,  0,  0 },
22198           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  3, -5,  0,  0,  0 },
22199           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -2,  0,  0,  0 },
22200           {  2,  0, -2, -2, -2,  0,  0, -2,  0,  2,  0,  0,  0,  0 },
22201           {  1,  0,  0,  0,  1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22202           {  1,  0,  0,  0, -1,  0,-10,  3,  0,  0,  0,  0,  0,  0 },
22203           {  0,  0,  2,  0,  2,  0,  2, -3,  0,  0,  0,  0,  0,  0 },
22204           {  0,  0,  2,  0,  2,  0,  2, -2,  0,  0,  0,  0,  0,  0 },
22205 
22206        /* 571-580 */
22207           {  0,  0,  2,  0,  2,  0, -2,  3,  0,  0,  0,  0,  0,  0 },
22208           {  0,  0,  2,  0,  2,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22209           {  0,  0,  0,  0,  2,  0,  0,  0,  0,  1,  0,  0,  0,  0 },
22210           {  0,  0,  0,  0,  1,  0,  0, -1,  0,  2,  0,  0,  0,  0 },
22211           {  2,  0,  2, -2,  2,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22212           {  2,  0,  1, -3,  1,  0, -6,  7,  0,  0,  0,  0,  0,  0 },
22213           {  2,  0,  0, -2,  0,  0,  2, -5,  0,  0,  0,  0,  0,  0 },
22214           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  5, -5,  0,  0,  0 },
22215           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  1,  5,  0,  0,  0 },
22216           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  5,  0,  0,  0 },
22217 
22218        /* 581-590 */
22219           {  2,  0,  0, -2,  0,  0,  0, -2,  0,  0,  2,  0,  0,  0 },
22220           {  2,  0,  0, -2,  0,  0, -4,  4,  0,  0,  0,  0,  0,  0 },
22221           {  2,  0, -2,  0, -2,  0,  0,  5, -9,  0,  0,  0,  0,  0 },
22222           {  2,  0, -1, -1,  0,  0,  0, -1,  0,  3,  0,  0,  0,  0 },
22223           {  1,  0,  2,  0,  2,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22224           {  1,  0,  2,  0,  2,  0,  0,  4, -8,  3,  0,  0,  0,  0 },
22225           {  1,  0,  2,  0,  2,  0,  0, -4,  8, -3,  0,  0,  0,  0 },
22226           {  1,  0,  2,  0,  2,  0, -1,  1,  0,  0,  0,  0,  0,  0 },
22227           {  1,  0,  2, -2,  2,  0, -3,  3,  0,  0,  0,  0,  0,  0 },
22228           {  1,  0,  0,  0,  0,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22229 
22230        /* 591-600 */
22231           {  1,  0,  0,  0,  0,  0,  0, -2,  0,  3,  0,  0,  0,  0 },
22232           {  1,  0,  0, -2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22233           {  1,  0, -2, -2, -2,  0,  0,  1,  0, -1,  0,  0,  0,  0 },
22234           {  1,  0, -1,  1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22235           {  1,  0, -1, -1,  0,  0,  0,  8,-15,  0,  0,  0,  0,  0 },
22236           {  0,  0,  2,  2,  2,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22237           {  0,  0,  2, -2,  1,  0,  1, -1,  0,  0,  0,  0,  0,  0 },
22238           {  0,  0,  2, -2,  1,  0,  0, -2,  0,  1,  0,  0,  0,  0 },
22239           {  0,  0,  2, -2,  1,  0,  0,-10, 15,  0,  0,  0,  0,  0 },
22240           {  0,  0,  2, -2,  0, -1,  0,  2,  0,  0,  0,  0,  0,  0 },
22241 
22242        /* 601-610 */
22243           {  0,  0,  1, -1,  2,  0,  0, -1,  0,  0, -1,  0,  0,  0 },
22244           {  0,  0,  1, -1,  2,  0, -3,  4,  0,  0,  0,  0,  0,  0 },
22245           {  0,  0,  1, -1,  1,  0, -4,  6,  0,  0,  0,  0,  0,  0 },
22246           {  0,  0,  1, -1,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22247           {  0,  0,  1, -1,  0,  0,  0,  1,  0,  0,  0,  0,  0,  0 },
22248           {  0,  0,  1, -1,  0,  0,  0, -1,  0,  0, -2,  0,  0,  0 },
22249           {  0,  0,  1, -1,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22250           {  0,  0,  1, -1,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0 },
22251           {  0,  0,  1, -1, -1,  0, -5,  7,  0,  0,  0,  0,  0,  0 },
22252           {  0,  0,  0,  2,  0,  0,  0,  2,  0, -2,  0,  0,  0,  0 },
22253 
22254        /* 611-620 */
22255           {  0,  0,  0,  2,  0,  0, -2,  2,  0,  0,  0,  0,  0,  0 },
22256           {  0,  0,  0,  0,  2,  0, -3,  5,  0,  0,  0,  0,  0,  0 },
22257           {  0,  0,  0,  0,  1,  0, -1,  2,  0,  0,  0,  0,  0,  0 },
22258           {  0,  0,  0,  0,  0,  0,  9,-13,  0,  0,  0,  0,  0, -2 },
22259           {  0,  0,  0,  0,  0,  0,  8,-14,  0,  0,  0,  0,  0, -2 },
22260           {  0,  0,  0,  0,  0,  0,  8,-11,  0,  0,  0,  0,  0, -1 },
22261           {  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0,  0,  0 },
22262           {  0,  0,  0,  0,  0,  0,  6, -8,  0,  0,  0,  0,  0,  0 },
22263           {  0,  0,  0,  0,  0,  0,  6, -7,  0,  0,  0,  0,  0, -1 },
22264           {  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0, -2 },
22265 
22266        /* 621-630 */
22267           {  0,  0,  0,  0,  0,  0,  5, -6, -4,  0,  0,  0,  0, -2 },
22268           {  0,  0,  0,  0,  0,  0,  5, -4,  0,  0,  0,  0,  0,  2 },
22269           {  0,  0,  0,  0,  0,  0,  4, -8,  0,  0,  0,  0,  0, -2 },
22270           {  0,  0,  0,  0,  0,  0,  4, -5,  0,  0,  0,  0,  0,  0 },
22271           {  0,  0,  0,  0,  0,  0,  3, -3,  0,  2,  0,  0,  0,  2 },
22272           {  0,  0,  0,  0,  0,  0,  3, -1,  0,  0,  0,  0,  0,  0 },
22273           {  0,  0,  0,  0,  0,  0,  2,  0,  0,  0,  0,  0,  0,  0 },
22274           {  0,  0,  0,  0,  0,  0,  1, -1,  0,  0,  0,  0,  0, -2 },
22275           {  0,  0,  0,  0,  0,  0,  0,  7,-12,  0,  0,  0,  0, -2 },
22276           {  0,  0,  0,  0,  0,  0,  0,  6, -9,  0,  0,  0,  0, -2 },
22277 
22278        /* 631-640 */
22279           {  0,  0,  0,  0,  0,  0,  0,  6, -8,  1,  5,  0,  0,  2 },
22280           {  0,  0,  0,  0,  0,  0,  0,  6, -4,  0,  0,  0,  0,  2 },
22281           {  0,  0,  0,  0,  0,  0,  0,  6,-10,  0,  0,  0,  0,  0 },
22282           {  0,  0,  0,  0,  0,  0,  0,  5,  0, -4,  0,  0,  0,  2 },
22283           {  0,  0,  0,  0,  0,  0,  0,  5, -9,  0,  0,  0,  0, -1 },
22284           {  0,  0,  0,  0,  0,  0,  0,  5, -8,  3,  0,  0,  0,  2 },
22285           {  0,  0,  0,  0,  0,  0,  0,  5, -7,  0,  0,  0,  0, -2 },
22286           {  0,  0,  0,  0,  0,  0,  0,  5, -6,  0,  0,  0,  0,  0 },
22287           {  0,  0,  0,  0,  0,  0,  0,  5,-16,  4,  5,  0,  0, -2 },
22288           {  0,  0,  0,  0,  0,  0,  0,  5,-13,  0,  0,  0,  0, -2 },
22289 
22290        /* 641-650 */
22291           {  0,  0,  0,  0,  0,  0,  0,  3,  0, -5,  0,  0,  0, -2 },
22292           {  0,  0,  0,  0,  0,  0,  0,  3, -9,  0,  0,  0,  0, -2 },
22293           {  0,  0,  0,  0,  0,  0,  0,  3, -7,  0,  0,  0,  0, -2 },
22294           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  2,  0,  0,  0,  2 },
22295           {  0,  0,  0,  0,  0,  0,  0,  2,  0,  0, -3,  0,  0,  0 },
22296           {  0,  0,  0,  0,  0,  0,  0,  2, -8,  1,  5,  0,  0, -2 },
22297           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  1, -5,  0,  0,  0 },
22298           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  2,  0,  0,  2 },
22299           {  0,  0,  0,  0,  0,  0,  0,  1,  0,  0, -3,  0,  0,  0 },
22300           {  0,  0,  0,  0,  0,  0,  0,  1,  0, -3,  5,  0,  0,  0 },
22301 
22302        /* 651-NFPL */
22303           {  0,  0,  0,  0,  0,  0,  0,  1, -3,  0,  0,  0,  0,  0 },
22304           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  2, -6,  3,  0, -2 },
22305           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  1, -2,  0,  0,  0 },
22306           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0 },
22307           {  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  2 },
22308           {  0,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0,  0,  0 }
22309        };
22310 
22311       /**
22312        *
22313        *  Time scale transformation:  Terrestrial Time, TT, to International
22314        *  Atomic Time, TAI.
22315        *
22316        * <p>This function is derived from the International Astronomical Union's
22317        *  SOFA (Standards of Fundamental Astronomy) software collection.
22318        *
22319        *<p>Status:  canonical.
22320        *
22321        *<!-- Given: -->
22322        *    @param tt1    double    TT as a 2-part Julian Date
22323        *    @param tt2    double    TT as a 2-part Julian Date
22324        *
22325        *<!-- Returned:-->
22326        *     @return   TAI as a 2-part Julian Date
22327        *
22328        *  Returned (function value):
22329        *                int       status:  0 = OK
22330        *
22331        *  Note:
22332        *
22333        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22334        *     the two arguments, for example where tt1 is the Julian Day Number
22335        *     and tt2 is the fraction of a day.  The returned tai1,tai2 follow
22336        *     suit.
22337        *
22338        *<p>References:
22339        *
22340        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22341        *     IERS Technical Note No. 32, BKG (2004)
22342        *
22343        *     Explanatory Supplement to the Astronomical Almanac,
22344        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22345        *
22346        *@version 2010 May 13
22347        *
22348        *@since SOFA release 2010-12-01
22349        *
22350        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22351        */
22352       public static JulianDate jauTttai(double tt1, double tt2)
22353       {
22354           double tai1, tai2;
22355           /* TT minus TAI (days). */
22356           final double dtat = TTMTAI / 86400.0;
22357 
22358 
22359           /* Result, safeguarding precision. */
22360           if ( tt1 > tt2 ) {
22361               tai1 = tt1;
22362               tai2 = tt2 - dtat;
22363           } else {
22364               tai1 = tt1 - dtat;
22365               tai2 = tt2;
22366           }
22367 
22368           return new JulianDate(tai1, tai2);
22369 
22370       };
22371 
22372       /**
22373        *
22374        *  Time scale transformation:  Terrestrial Time, TT, to Geocentric
22375        *  Coordinate Time, TCG.
22376        *
22377        * <p>This function is derived from the International Astronomical Union's
22378        *  SOFA (Standards of Fundamental Astronomy) software collection.
22379        *
22380        *<p>Status:  canonical.
22381        *
22382        *<!-- Given: -->
22383        *     @param tt1 double    TT as a 2-part Julian Date
22384        *     @param tt2 double    TT as a 2-part Julian Date
22385        *
22386        *<!-- Returned:-->
22387        *     @return   TCG as a 2-part Julian Date
22388        *
22389        *  Returned (function value):
22390        *                int       status:  0 = OK
22391        *
22392        *  Note:
22393        *
22394        *     tt1+tt2 is Julian Date, apportioned in any convenient way between
22395        *     the two arguments, for example where tt1 is the Julian Day Number
22396        *     and tt2 is the fraction of a day.  The returned tcg1,tcg2 follow
22397        *     suit.
22398        *
22399        *<p>References:
22400        *
22401        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22402        *     IERS Technical Note No. 32, BKG (2004)
22403        *
22404        *     IAU 2000 Resolution B1.9
22405        *
22406        *@version 2010 May 13
22407        *
22408        *@since SOFA release 2010-12-01
22409        *
22410        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22411        */
22412       public static JulianDate jauTttcg(double tt1, double tt2)
22413 
22414       {
22415           double tcg1, tcg2;
22416 
22417           /* 1977 Jan 1 00:00:32.184 TT, as MJD */
22418           final double t77t = DJM77 + TTMTAI/DAYSEC;
22419 
22420           /* TT to TCG rate */
22421           final double elgg = ELG/(1.0-ELG);
22422 
22423 
22424           /* Result, safeguarding precision. */
22425           if ( tt1 > tt2 ) {
22426               tcg1 = tt1;
22427               tcg2 = tt2 + ( ( tt1 - DJM0 ) + ( tt2 - t77t ) ) * elgg;
22428           } else {
22429               tcg1 = tt1 + ( ( tt2 - DJM0 ) + ( tt1 - t77t ) ) * elgg;
22430               tcg2 = tt2;
22431           }
22432 
22433           return new JulianDate(tcg1, tcg2);
22434 
22435       };      
22436 
22437       /**
22438        *
22439        *  Time scale transformation:  Terrestrial Time, TT, to Barycentric
22440        *  Dynamical Time, TDB.
22441        *
22442        * <p>This function is derived from the International Astronomical Union's
22443        *  SOFA (Standards of Fundamental Astronomy) software collection.
22444        *
22445        *<p>Status:  canonical.
22446        *
22447        *<!-- Given: -->
22448        *     @param tt1    double    TT as a 2-part Julian Date
22449        *     @param tt2    double    TT as a 2-part Julian Date
22450        *     @param dtr        double    TDB-TT in seconds
22451        *
22452        *<!-- Returned:-->
22453        *     @return   TDB as a 2-part Julian Date
22454        *
22455        *  Returned (function value):
22456        *                int       status:  0 = OK
22457        *
22458        *<p>Notes:
22459        *
22460        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22461        *     the two arguments, for example where tt1 is the Julian Day Number
22462        *     and tt2 is the fraction of a day.  The returned tdb1,tdb2 follow
22463        *     suit.
22464        *
22465        *  2  The argument dtr represents the quasi-periodic component of the
22466        *     GR transformation between TT and TCB.  It is dependent upon the
22467        *     adopted solar-system ephemeris, and can be obtained by numerical
22468        *     integration, by interrogating a precomputed time ephemeris or by
22469        *     evaluating a model such as that implemented in the SOFA function
22470        *     jauDtdb.   The quantity is dominated by an annual term of 1.7 ms
22471        *     amplitude.
22472        *
22473        *  3  TDB is essentially the same as Teph, the time argument for the JPL
22474        *     solar system ephemerides.
22475        *
22476        *<p>References:
22477        *
22478        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22479        *     IERS Technical Note No. 32, BKG (2004)
22480        *
22481        *     IAU 2006 Resolution 3
22482        *
22483        *@version 2010 May 13
22484        *
22485        *@since SOFA release 2010-12-01
22486        *
22487        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22488        */
22489       public static JulianDate jauTttdb(double tt1, double tt2, double dtr)
22490       {
22491 
22492           double tdb1, tdb2;
22493           double dtrd;
22494 
22495 
22496           /* Result, safeguarding precision. */
22497           dtrd = dtr / DAYSEC;
22498           if ( tt1 > tt2 ) {
22499               tdb1 = tt1;
22500               tdb2 = tt2 + dtrd;
22501           } else {
22502               tdb1 = tt1 + dtrd;
22503               tdb2 = tt2;
22504           }
22505 
22506           return new JulianDate(tdb1, tdb2);
22507 
22508       };
22509 
22510       /**
22511        *
22512        *  Time scale transformation:  Terrestrial Time, TT, to Universal Time,
22513        *  UT1.
22514        *
22515        * <p>This function is derived from the International Astronomical Union's
22516        *  SOFA (Standards of Fundamental Astronomy) software collection.
22517        *
22518        *<p>Status:  canonical.
22519        *
22520        *<!-- Given: -->
22521        *    @param tt1    double    TT as a 2-part Julian Date
22522        *    @param tt2    double    TT as a 2-part Julian Date
22523        *    @param dt         double    TT-UT1 in seconds
22524        *
22525        *<!-- Returned:-->
22526        *     @return   UT1 as a 2-part Julian Date
22527        *
22528        *  Returned (function value):
22529        *                int       status:  0 = OK
22530        *
22531        *<p>Notes:
22532        *
22533        *  1  tt1+tt2 is Julian Date, apportioned in any convenient way between
22534        *     the two arguments, for example where tt1 is the Julian Day Number
22535        *     and tt2 is the fraction of a day.  The returned ut11,ut12 follow
22536        *     suit.
22537        *
22538        *  2  The argument dt is classical Delta T.
22539        *
22540        *  Reference:
22541        *
22542        *     Explanatory Supplement to the Astronomical Almanac,
22543        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22544        *
22545        *@version 2010 May 16
22546        *
22547        *@since SOFA release 2010-12-01
22548        *
22549        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22550        */
22551       public static JulianDate jauTtut1(double tt1, double tt2, double dt)
22552 
22553       {
22554 
22555           double ut11, ut12;
22556           double dtd;
22557 
22558 
22559           /* Result, safeguarding precision. */
22560           dtd = dt / DAYSEC;
22561           if ( tt1 > tt2 ) {
22562               ut11 = tt1;
22563               ut12 = tt2 - dtd;
22564           } else {
22565               ut11 = tt1 - dtd;
22566               ut12 = tt2;
22567           }
22568 
22569           return new JulianDate(ut11, ut12);
22570       };
22571 
22572       /**
22573        *
22574        *  Time scale transformation:  Universal Time, UT1, to International
22575        *  Atomic Time, TAI.
22576        *
22577        * <p>This function is derived from the International Astronomical Union's
22578        *  SOFA (Standards of Fundamental Astronomy) software collection.
22579        *
22580        *<p>Status:  canonical.
22581        *
22582        *<!-- Given: -->
22583        *   @param  ut11  double    UT1 as a 2-part Julian Date
22584        *   @param  ut12  double    UT1 as a 2-part Julian Date
22585        *   @param  dta        double    UT1-TAI in seconds
22586        *
22587        *<!-- Returned:-->
22588        *    @return    TAI as a 2-part Julian Date
22589        *
22590        *  Returned (function value):
22591        *                int       status:  0 = OK
22592        *
22593        *<p>Notes:
22594        *
22595        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22596        *     between the two arguments, for example where ut11 is the Julian
22597        *     Day Number and ut12 is the fraction of a day.  The returned
22598        *     TAI1,TAI2 follow suit.
22599        *
22600        *  2  The argument dta, i.e. UT1-TAI, is an observed quantity, and is
22601        *     available from IERS tabulations.
22602        *
22603        *  Reference:
22604        *
22605        *     Explanatory Supplement to the Astronomical Almanac,
22606        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22607        *
22608        *@version 2010 May 16
22609        *
22610        *@since SOFA release 2010-12-01
22611        *
22612        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22613        */
22614       public static JulianDate jauUt1tai(double ut11, double ut12, double dta )
22615 
22616       {
22617           double tai1, tai2;
22618           double dtad;
22619 
22620 
22621           /* Result, safeguarding precision. */
22622           dtad = dta / DAYSEC;
22623           if ( ut11 > ut12 ) {
22624               tai1 = ut11;
22625               tai2 = ut12 - dtad;
22626           } else {
22627               tai1 = ut11 - dtad;
22628               tai2 = ut12;
22629           }
22630           return new JulianDate(tai1, tai2);
22631 
22632       };
22633 
22634       /**
22635        *
22636        *  Time scale transformation:  Universal Time, UT1, to Terrestrial
22637        *  Time, TT.
22638        *
22639        * <p>This function is derived from the International Astronomical Union's
22640        *  SOFA (Standards of Fundamental Astronomy) software collection.
22641        *
22642        *<p>Status:  canonical.
22643        *
22644        *<!-- Given: -->
22645        *   @param  ut11  double    UT1 as a 2-part Julian Date
22646        *   @param  ut12  double    UT1 as a 2-part Julian Date
22647        *   @param  dt         double    TT-UT1 in seconds
22648        *
22649        *<!-- Returned:-->
22650        *     @return    TAI as a 2-part Julian Date
22651        *
22652        *  Returned (function value):
22653        *                int       status:  0 = OK
22654        *
22655        *<p>Notes:
22656        *
22657        *  1  ut11+ut12 is Julian Date, apportioned in any convenient way
22658        *     between the two arguments, for example where ut11 is the Julian
22659        *     Day Number and ut12 is the fraction of a day.  The returned
22660        *     tt1,tt2 follow suit.
22661        *
22662        *  2  The argument dt is classical Delta T.
22663        *
22664        *  Reference:
22665        *
22666        *     Explanatory Supplement to the Astronomical Almanac,
22667        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22668        *
22669        *@version 2010 May 16
22670        *
22671        *@since SOFA release 2010-12-01
22672        *
22673        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22674        */
22675       public static JulianDate jauUt1tt(double ut11, double ut12, double dt)
22676       {
22677 
22678           double tt1, tt2;
22679           double dtd;
22680 
22681 
22682           /* Result, safeguarding precision. */
22683           dtd = dt / DAYSEC;
22684           if ( ut11 > ut12 ) {
22685               tt1 = ut11;
22686               tt2 = ut12 + dtd;
22687           } else {
22688               tt1 = ut11 + dtd;
22689               tt2 = ut12;
22690           }
22691 
22692           return new JulianDate(tt1, tt2);
22693 
22694       };
22695 
22696       /**
22697        *
22698        *  Time scale transformation:  Universal Time, UT1, to Coordinated
22699        *  Universal Time, UTC.
22700        *
22701        * <p>This function is derived from the International Astronomical Union's
22702        *  SOFA (Standards of Fundamental Astronomy) software collection.
22703        *
22704        *<p>Status:  canonical.
22705        *
22706        *<!-- Given: -->
22707        *  @param ut11 double   UT1 as a 2-part Julian Date (Note 1)
22708        *  @param ut12 double   UT1 as a 2-part Julian Date (Note 1) 
22709        *  @param   dut1       double   Delta UT1: UT1-UTC in seconds (Note 2)
22710        *
22711        *<!-- Returned:-->
22712        *     @return  JulianDate   UTC as a 2-part quasi Julian Date (Notes 3,4)
22713        *
22714        *  Returned (function value):
22715        *                int      status: +1 = dubious year (Note 5)
22716        *                                  0 = OK
22717        *                                 -1 = unacceptable date
22718        *
22719        *<p>Notes:
22720        *<ol>
22721        *  <li>  ut11+ut12 is Julian Date, apportioned in any convenient way
22722        *     between the two arguments, for example where ut11 is the Julian
22723        *     Day Number and ut12 is the fraction of a day.  The returned utc1
22724        *     and utc2 form an analogous pair, except that a special convention
22725        *     is used, to deal with the problem of leap seconds - see Note 3.
22726        *
22727        *  <li> Delta UT1 can be obtained from tabulations provided by the
22728        *     International Earth Rotation and Reference Systems Service.  The
22729        *     value changes abruptly by 1s at a leap second;  however, close to
22730        *     a leap second the algorithm used here is tolerant of the "wrong"
22731        *     choice of value being made.
22732        *
22733        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22734        *     special measures are taken.  The convention in the present
22735        *     function is that the returned quasi JD day UTC1+UTC2 represents
22736        *     UTC days whether the length is 86399, 86400 or 86401 SI seconds.
22737        *
22738        *  <li> The function jauD2dtf can be used to transform the UTC quasi-JD
22739        *     into calendar date and clock time, including UTC leap second
22740        *     handling.
22741        *
22742        *  <li> The warning status "dubious year" flags UTCs that predate the
22743        *     introduction of the time scale and that are too far in the future
22744        *     to be trusted.  See jauDat for further details.
22745        *</ol>
22746        *  Called:
22747        *  <ul>
22748        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22749        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22750        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22751        *</ul>
22752        *<p>References:
22753        *
22754        *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22755        *     IERS Technical Note No. 32, BKG (2004)
22756        *
22757        *     <p>Explanatory Supplement to the Astronomical Almanac,
22758        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22759        *
22760        *@version 2010 May 16
22761        *
22762        *@since SOFA release 2010-12-01
22763        *
22764        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22765        * @throws JSOFAIllegalParameter 
22766        * @throws JSOFAInternalError an internal error has occured
22767        */
22768       public static JulianDate jauUt1utc(double ut11, double ut12, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
22769 
22770       {
22771 
22772           double utc1, utc2;
22773           boolean big1;
22774           int i;
22775           double duts, u1, u2, d1, dats1, d2, fd, dats2, ddats, us1, us2, du;
22776 
22777 
22778           /* UT1-UTC in seconds. */
22779           duts = dut1;
22780 
22781           /* Put the two parts of the UT1 into big-first order. */
22782           big1 = ( ut11 >= ut12 );
22783           if ( big1 ) {
22784               u1 = ut11;
22785               u2 = ut12;
22786           } else {
22787               u1 = ut12;
22788               u2 = ut11;
22789           }
22790 
22791           /* See if the UT1 can possibly be in a leap-second day. */
22792           d1 = u1;
22793           dats1 = 0;
22794           for ( i = -1; i <= 3; i++ ) {
22795               d2 = u2 + (double) i;
22796               Calendar dt = jauJd2cal(d1, d2 );
22797               dats2 = jauDat(dt.iy, dt.im, dt.id, 0.0);
22798               if ( i == - 1 ) dats1 = dats2;
22799               ddats = dats2 - dats1;
22800               if ( abs(ddats) >= 0.5 ) {
22801 
22802                   /* Yes, leap second nearby: ensure UT1-UTC is "before" value. */
22803                   if ( ddats * duts >= 0 ) duts -= ddats;
22804 
22805                   /* UT1 for the start of the UTC day that ends in a leap. */
22806                   JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id );
22807                   d1 = jd.djm0; d2 = jd.djm1;
22808                   us1 = d1;
22809                   us2 = d2 - 1.0 + duts/DAYSEC;
22810 
22811                   /* Is the UT1 after this point? */
22812                   du = u1 - us1;
22813                   du += u2 - us2;
22814                   if ( du > 0 ) {
22815 
22816                       /* Yes:  fraction of the current UTC day that has elapsed. */
22817                       fd = du * DAYSEC / ( DAYSEC + ddats );
22818 
22819                       /* Ramp UT1-UTC to bring about SOFA's JD(UTC) convention. */
22820                       duts += ddats * ( fd <= 1.0 ? fd : 1.0 );
22821                   }
22822 
22823                   /* Done. */
22824                   break;
22825               }
22826               dats1 = dats2;
22827           }
22828 
22829           /* Subtract the (possibly adjusted) UT1-UTC from UT1 to give UTC. */
22830           u2 -= duts / DAYSEC;
22831 
22832           /* Result, safeguarding precision. */
22833           if ( big1 ) {
22834               utc1 = u1;
22835               utc2 = u2;
22836           } else {
22837               utc1 = u2;
22838               utc2 = u1;
22839           }
22840 
22841           /* FIXME Status. */
22842           return new JulianDate(utc1, utc2);
22843 
22844       };
22845 
22846       /**
22847        *
22848        *  Time scale transformation:  Coordinated Universal Time, UTC, to
22849        *  International Atomic Time, TAI.
22850        *
22851        * <p>This function is derived from the International Astronomical Union's
22852        *  SOFA (Standards of Fundamental Astronomy) software collection.
22853        *
22854        *<p>Status:  canonical.
22855        *
22856        *<!-- Given: -->
22857        *     @param utc1 double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22858        *     @param utc2 double   UTC as a 2-part quasi Julian Date (Notes 1-4) 
22859        *
22860        *<!-- Returned:-->
22861        *     @return JulianDate     TAI as a 2-part Julian Date (Note 5)
22862        *
22863        *  Returned (function value):
22864        *                int      status: +1 = dubious year (Note 3)
22865        *                                  0 = OK
22866        *                                 -1 = unacceptable date
22867        *
22868        *<p>Notes:
22869        *<ol>
22870        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
22871        *     convenient way between the two arguments, for example where utc1
22872        *     is the Julian Day Number and utc2 is the fraction of a day.
22873        *
22874        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22875        *     special measures are taken.  The convention in the present
22876        *     function is that the JD day represents UTC days whether the
22877        *     length is 86399, 86400 or 86401 SI seconds.
22878        *
22879        *  <li> The warning status "dubious year" flags UTCs that predate the
22880        *     introduction of the time scale and that are too far in the future
22881        *     to be trusted.  See jauDat  for further details.
22882        *
22883        *  <li> The function jauDtf2d converts from calendar date and time of day
22884        *     into 2-part Julian Date, and in the case of UTC implements the
22885        *     leap-second-ambiguity convention described above.
22886        *
22887        *  <li> The returned TAI1,TAI2 are such that their sum is the TAI Julian
22888        *     Date.
22889        *</ol>
22890        *  Called:<ul>
22891        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
22892        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
22893        *     <li>{@link #jauCal2jd}    Gregorian calendar to JD
22894        *</ul>
22895        *<p>References:
22896        *
22897        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
22898        *     IERS Technical Note No. 32, BKG (2004)
22899        *
22900        *     Explanatory Supplement to the Astronomical Almanac,
22901        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
22902        *
22903        *@version 2010 September 10
22904        *
22905        *@since SOFA release 2010-12-01
22906        *
22907        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
22908      * @throws JSOFAInternalError an internal error has occured
22909      * @throws JSOFAIllegalParameter 
22910        *
22911        */
22912       public static JulianDate jauUtctai(double utc1, double utc2) throws JSOFAIllegalParameter, JSOFAInternalError
22913 
22914       {
22915           double tai1, tai2;
22916           boolean big1;
22917           double u1, u2,  dats,  datst, ddat, a2, fd;
22918 
22919 
22920           /* Put the two parts of the UTC into big-first order. */
22921           big1 = ( utc1 >= utc2 );
22922           if ( big1 ) {
22923               u1 = utc1;
22924               u2 = utc2;
22925           } else {
22926               u1 = utc2;
22927               u2 = utc1;
22928           }
22929 
22930           /* Get TAI-UTC now. */
22931           Calendar dt = jauJd2cal(u1, u2 );
22932           dats = jauDat(dt.iy, dt.im, dt.id, dt.fd);
22933  //         if ( js < 0 ) return -1;
22934           fd = dt.fd;
22935           /* Get TAI-UTC tomorrow. */
22936           Calendar dtt = jauJd2cal(u1+1.5, u2-fd );
22937           datst = jauDat(dtt.iy, dtt.im, dtt.id, dtt.fd);
22938 //          if ( js < 0 ) return -1;
22939 
22940           /* If today ends in a leap second, scale the fraction into SI days. */
22941           ddat = datst - dats;
22942           if ( abs(ddat) > 0.5 ) fd += fd * ddat / DAYSEC;
22943 
22944           /* Today's calendar date to 2-part JD. */
22945           JulianDate jd = jauCal2jd(dt.iy, dt.im, dt.id ) ;
22946 
22947           /* Assemble the TAI result, preserving the UTC split and order. */
22948           a2 = jd.djm0 - u1;
22949           a2 += jd.djm1;
22950           a2 += fd + dats / DAYSEC;
22951           if ( big1 ) {
22952               tai1 = u1;
22953               tai2 = a2;
22954           } else {
22955               tai1 = a2;
22956               tai2 = u1;
22957           }
22958 
22959           /* FIXME Status. */
22960           return new JulianDate(tai1, tai2);
22961 
22962       };
22963 
22964       /**
22965        *
22966        *  Time scale transformation:  Coordinated Universal Time, UTC, to
22967        *  Universal Time, UT1.
22968        *
22969        * <p>This function is derived from the International Astronomical Union's
22970        *  SOFA (Standards of Fundamental Astronomy) software collection.
22971        *
22972        *<p>Status:  canonical.
22973        *
22974        *<!-- Given: -->
22975        *   @param  utc1  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22976        *   @param  utc2  double   UTC as a 2-part quasi Julian Date (Notes 1-4)
22977        *   @param  dut1       double   Delta UT1 = UT1-UTC in seconds (Note 5)
22978        *
22979        *<!-- Returned:-->
22980        *     @return UT1 as a 2-part Julian Date (Note 6)
22981        *
22982        *  Returned (function value):
22983        *                int      status: +1 = dubious year (Note 7)
22984        *                                  0 = OK
22985        *                                 -1 = unacceptable date
22986        *
22987        *<p>Notes:
22988        *<ol>
22989        *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
22990        *     convenient way between the two arguments, for example where utc1
22991        *     is the Julian Day Number and utc2 is the fraction of a day.
22992        *
22993        *  <li> JD cannot unambiguously represent UTC during a leap second unless
22994        *     special measures are taken.  The convention in the present
22995        *     function is that the JD day represents UTC days whether the
22996        *     length is 86399, 86400 or 86401 SI seconds.
22997        *
22998        *  <li> The warning status "dubious year" flags UTCs that predate the
22999        *     introduction of the time scale and that are too far in the future
23000        *     to be trusted.  See jauDat  for further details.
23001        *
23002        *  <li> The function jauDtf2d  converts from calendar date and time of
23003        *     day into 2-part Julian Date, and in the case of UTC implements
23004        *     the leap-second-ambiguity convention described above.
23005        *
23006        *  <li> Delta UT1 can be obtained from tabulations provided by the
23007        *     International Earth Rotation and Reference Systems Service.  It
23008        *     It is the caller's responsibility to supply a DUT argument
23009        *     containing the UT1-UTC value that matches the given UTC.
23010        *
23011        *  <li> The returned ut11,ut12 are such that their sum is the UT1 Julian
23012        *     Date.
23013        *
23014        *  <li> The warning status "dubious year" flags UTCs that predate the
23015        *     introduction of the time scale and that are too far in the future
23016        *     to be trusted.  See jauDat for further details.
23017        *</ol>
23018        *<p>References:
23019        *
23020        *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
23021        *     IERS Technical Note No. 32, BKG (2004)
23022        *
23023        *     Explanatory Supplement to the Astronomical Almanac,
23024        *     P. Kenneth Seidelmann (ed), University Science Books (1992)
23025        *
23026        *  Called:<ul>
23027        *     <li>{@link #jauJd2cal}    JD to Gregorian calendar
23028        *     <li>{@link #jauDat}       delta(AT) = TAI-UTC
23029        *     <li>{@link #jauUtctai}    UTC to TAI
23030        *     <li>{@link #jauTaiut1}    TAI to UT1
23031        *</ul>
23032        *@version 2010 May 16
23033        *
23034        *@since SOFA release 2010-12-01
23035        *
23036        *  <!-- Copyright (C) 2010 IAU SOFA Board.  See notes at end. -->
23037      * @throws JSOFAInternalError an internal error has occured
23038      * @throws JSOFAIllegalParameter 
23039        */
23040       public static JulianDate jauUtcut1(double utc1, double utc2, double dut1) throws JSOFAIllegalParameter, JSOFAInternalError
23041       {
23042 
23043     
23044           double dta;
23045           /* Look up TAI-UTC. */
23046           Calendar dt = jauJd2cal(utc1, utc2) ;
23047           double dat = jauDat ( dt.iy, dt.im, dt.id, 0.0 );
23048      
23049 
23050           /* Form UT1-TAI. */
23051           dta = dut1 - dat;
23052 
23053           /* UTC to TAI to UT1. */
23054           JulianDate tai = jauUtctai(utc1, utc2);
23055           return jauTaiut1(tai.djm0, tai.djm1, dta) ;
23056 
23057       };
23058 
23059       
23060     public static CelestialIntermediatePole jauXy06(double date1, double date2)
23061     /**
23062     *  X,Y coordinates of celestial intermediate pole from series based
23063     *  on IAU 2006 precession and IAU 2000A nutation.
23064     *
23065     *<p>This function is derived from the International Astronomical Union's
23066     *  SOFA (Standards Of Fundamental Astronomy) software collection.
23067     *
23068     *<p>Status:  canonical model.
23069     *
23070     *<!-- Given: -->
23071     *     @param date1 double TT as a 2-part Julian Date (Note 1)
23072     *     @param date2 double TT as a 2-part Julian Date (Note 1)
23073     *
23074     *<!-- Returned: -->
23075     *     @return  CIP X,Y coordinates (Note 2)
23076     *
23077     * <p>Notes:
23078     * <ol>
23079     *
23080     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
23081     *     convenient way between the two arguments.  For example,
23082     *     JD(TT)=2450123.7 could be expressed in any of these ways,
23083     *     among others:
23084     *<pre>
23085     *            date1          date2
23086     *
23087     *         2450123.7           0.0       (JD method)
23088     *         2451545.0       -1421.3       (J2000 method)
23089     *         2400000.5       50123.2       (MJD method)
23090     *         2450123.5           0.2       (date &amp; time method)
23091     *</pre>
23092     *     The JD method is the most natural and convenient to use in
23093     *     cases where the loss of several decimal digits of resolution
23094     *     is acceptable.  The J2000 method is best matched to the way
23095     *     the argument is handled internally and will deliver the
23096     *     optimum resolution.  The MJD method and the date &amp; time methods
23097     *     are both good compromises between resolution and convenience.
23098     *
23099     * <li> The X,Y coordinates are those of the unit vector towards the
23100     *     celestial intermediate pole.  They represent the combined effects
23101     *     of frame bias, precession and nutation.
23102     *
23103     * <li> The fundamental arguments used are as adopted in IERS Conventions
23104     *     (2003) and are from Simon et al. (1994) and Souchay et al.
23105     *     (1999).
23106     *
23107     * <li> This is an alternative to the angles-based method, via the JSOFA
23108     *     function jauFw2xy and as used in jauXys06a for example.  The two
23109     *     methods agree at the 1 microarcsecond level (at present), a
23110     *     negligible amount compared with the intrinsic accuracy of the
23111     *     models.  However, it would be unwise to mix the two methods
23112     *     (angles-based and series-based) in a single application.
23113     *</ol>
23114     *<p>Called:<ul>
23115     *     <li>{@link #jauFal03} mean anomaly of the Moon
23116     *     <li>{@link #jauFalp03} mean anomaly of the Sun
23117     *     <li>{@link #jauFaf03} mean argument of the latitude of the Moon
23118     *     <li>{@link #jauFad03} mean elongation of the Moon from the Sun
23119     *     <li>{@link #jauFaom03} mean longitude of the Moon's ascending node
23120     *     <li>{@link #jauFame03} mean longitude of Mercury
23121     *     <li>{@link #jauFave03} mean longitude of Venus
23122     *     <li>{@link #jauFae03} mean longitude of Earth
23123     *     <li>{@link #jauFama03} mean longitude of Mars
23124     *     <li>{@link #jauFaju03} mean longitude of Jupiter
23125     *     <li>{@link #jauFasa03} mean longitude of Saturn
23126     *     <li>{@link #jauFaur03} mean longitude of Uranus
23127     *     <li>{@link #jauFane03} mean longitude of Neptune
23128     *     <li>{@link #jauFapa03} general accumulated precession in longitude
23129     * </ul>
23130     *<p>References:
23131     *
23132     *    <p>Capitaine, N., Wallace, P.T. &amp; Chapront, J., 2003,
23133     *     Astron.Astrophys., 412, 567
23134     *
23135     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
23136     *
23137     *     <p>McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
23138     *     IERS Technical Note No. 32, BKG
23139     *
23140     *     Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
23141     *     Francou, G. &amp; Laskar, J., Astron.Astrophys., 1994, 282, 663
23142     *
23143     *     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., 1999,
23144     *     Astron.Astrophys.Supp.Ser. 135, 111
23145     *
23146     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
23147     *
23148     *@version 2009 October 16
23149     *
23150     *  @since Release 20101201
23151     *
23152     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
23153     */
23154     {
23155 
23156     /* Maximum power of T in the polynomials for X and Y */
23157        final int MAXPT = (5);
23158 
23159     /* Polynomial coefficients (arcsec, X then Y). */
23160        final double xyp[][] = {
23161 
23162           {    -0.016617,
23163              2004.191898,
23164                -0.4297829,
23165                -0.19861834,
23166                 0.000007578,
23167                 0.0000059285
23168           },
23169           {    -0.006951,
23170                -0.025896,
23171               -22.4072747,
23172                 0.00190059,
23173                 0.001112526,
23174                 0.0000001358
23175           }
23176        };
23177 
23178     /* N.B mfals defined as class static (outside this method) to avoid problems with 65535 byte limit for methods */ 
23179     /* Number of frequencies:  luni-solar */
23180         final int NFLS = mfals.length;
23181 
23182     /* Number of frequencies:  planetary */
23183        final int NFPL =mfapl.length ;
23184 
23185     /* Pointers into amplitudes array, one pointer per frequency */
23186        final int nc[] = {
23187 
23188        /* 1-100 */
23189            1,    21,    37,    51,    65,    79,    91,   103,   115,   127,
23190          139,   151,   163,   172,   184,   196,   207,   219,   231,   240,
23191          252,   261,   273,   285,   297,   309,   318,   327,   339,   351,
23192          363,   372,   384,   396,   405,   415,   423,   435,   444,   452,
23193          460,   467,   474,   482,   490,   498,   506,   513,   521,   528,
23194          536,   543,   551,   559,   566,   574,   582,   590,   597,   605,
23195          613,   620,   628,   636,   644,   651,   658,   666,   674,   680,
23196          687,   695,   702,   710,   717,   725,   732,   739,   746,   753,
23197          760,   767,   774,   782,   790,   798,   805,   812,   819,   826,
23198          833,   840,   846,   853,   860,   867,   874,   881,   888,   895,
23199 
23200        /* 101-200 */
23201          901,   908,   914,   921,   928,   934,   941,   948,   955,   962,
23202          969,   976,   982,   989,   996,  1003,  1010,  1017,  1024,  1031,
23203         1037,  1043,  1050,  1057,  1064,  1071,  1078,  1084,  1091,  1098,
23204         1104,  1112,  1118,  1124,  1131,  1138,  1145,  1151,  1157,  1164,
23205         1171,  1178,  1185,  1192,  1199,  1205,  1212,  1218,  1226,  1232,
23206         1239,  1245,  1252,  1259,  1266,  1272,  1278,  1284,  1292,  1298,
23207         1304,  1310,  1316,  1323,  1329,  1335,  1341,  1347,  1353,  1359,
23208         1365,  1371,  1377,  1383,  1389,  1396,  1402,  1408,  1414,  1420,
23209         1426,  1434,  1440,  1446,  1452,  1459,  1465,  1471,  1477,  1482,
23210         1488,  1493,  1499,  1504,  1509,  1514,  1520,  1527,  1532,  1538,
23211 
23212        /* 201-300 */
23213         1543,  1548,  1553,  1558,  1564,  1569,  1574,  1579,  1584,  1589,
23214         1594,  1596,  1598,  1600,  1602,  1605,  1608,  1610,  1612,  1617,
23215         1619,  1623,  1625,  1627,  1629,  1632,  1634,  1640,  1642,  1644,
23216         1646,  1648,  1650,  1652,  1654,  1658,  1660,  1662,  1664,  1668,
23217         1670,  1672,  1673,  1675,  1679,  1681,  1683,  1684,  1686,  1688,
23218         1690,  1693,  1695,  1697,  1701,  1703,  1705,  1707,  1709,  1711,
23219         1712,  1715,  1717,  1721,  1723,  1725,  1727,  1729,  1731,  1733,
23220         1735,  1737,  1739,  1741,  1743,  1745,  1747,  1749,  1751,  1753,
23221         1755,  1757,  1759,  1761,  1762,  1764,  1766,  1768,  1769,  1771,
23222         1773,  1775,  1777,  1779,  1781,  1783,  1785,  1787,  1788,  1790,
23223 
23224        /* 301-400 */
23225         1792,  1794,  1796,  1798,  1800,  1802,  1804,  1806,  1807,  1809,
23226         1811,  1815,  1817,  1819,  1821,  1823,  1825,  1827,  1829,  1831,
23227         1833,  1835,  1837,  1839,  1840,  1842,  1844,  1848,  1850,  1852,
23228         1854,  1856,  1858,  1859,  1860,  1862,  1864,  1866,  1868,  1869,
23229         1871,  1873,  1875,  1877,  1879,  1881,  1883,  1885,  1887,  1889,
23230         1891,  1892,  1896,  1898,  1900,  1901,  1903,  1905,  1907,  1909,
23231         1910,  1911,  1913,  1915,  1919,  1921,  1923,  1927,  1929,  1931,
23232         1933,  1935,  1937,  1939,  1943,  1945,  1947,  1948,  1949,  1951,
23233         1953,  1955,  1957,  1958,  1960,  1962,  1964,  1966,  1968,  1970,
23234         1971,  1973,  1974,  1975,  1977,  1979,  1980,  1981,  1982,  1984,
23235 
23236        /* 401-500 */
23237         1986,  1988,  1990,  1992,  1994,  1995,  1997,  1999,  2001,  2003,
23238         2005,  2007,  2008,  2009,  2011,  2013,  2015,  2017,  2019,  2021,
23239         2023,  2024,  2025,  2027,  2029,  2031,  2033,  2035,  2037,  2041,
23240         2043,  2045,  2046,  2047,  2049,  2051,  2053,  2055,  2056,  2057,
23241         2059,  2061,  2063,  2065,  2067,  2069,  2070,  2071,  2072,  2074,
23242         2076,  2078,  2080,  2082,  2084,  2086,  2088,  2090,  2092,  2094,
23243         2095,  2096,  2097,  2099,  2101,  2105,  2106,  2107,  2108,  2109,
23244         2110,  2111,  2113,  2115,  2119,  2121,  2123,  2125,  2127,  2129,
23245         2131,  2133,  2135,  2136,  2137,  2139,  2141,  2143,  2145,  2147,
23246         2149,  2151,  2153,  2155,  2157,  2159,  2161,  2163,  2165,  2167,
23247 
23248        /* 501-600 */
23249         2169,  2171,  2173,  2175,  2177,  2179,  2181,  2183,  2185,  2186,
23250         2187,  2188,  2192,  2193,  2195,  2197,  2199,  2201,  2203,  2205,
23251         2207,  2209,  2211,  2213,  2217,  2219,  2221,  2223,  2225,  2227,
23252         2229,  2231,  2233,  2234,  2235,  2236,  2237,  2238,  2239,  2240,
23253         2241,  2244,  2246,  2248,  2250,  2252,  2254,  2256,  2258,  2260,
23254         2262,  2264,  2266,  2268,  2270,  2272,  2274,  2276,  2278,  2280,
23255         2282,  2284,  2286,  2288,  2290,  2292,  2294,  2296,  2298,  2300,
23256         2302,  2303,  2304,  2305,  2306,  2307,  2309,  2311,  2313,  2315,
23257         2317,  2319,  2321,  2323,  2325,  2327,  2329,  2331,  2333,  2335,
23258         2337,  2341,  2343,  2345,  2347,  2349,  2351,  2352,  2355,  2356,
23259 
23260        /* 601-700 */
23261         2357,  2358,  2359,  2361,  2363,  2364,  2365,  2366,  2367,  2368,
23262         2369,  2370,  2371,  2372,  2373,  2374,  2376,  2378,  2380,  2382,
23263         2384,  2385,  2386,  2387,  2388,  2389,  2390,  2391,  2392,  2393,
23264         2394,  2395,  2396,  2397,  2398,  2399,  2400,  2401,  2402,  2403,
23265         2404,  2405,  2406,  2407,  2408,  2409,  2410,  2411,  2412,  2413,
23266         2414,  2415,  2417,  2418,  2430,  2438,  2445,  2453,  2460,  2468,
23267         2474,  2480,  2488,  2496,  2504,  2512,  2520,  2527,  2535,  2543,
23268         2550,  2558,  2566,  2574,  2580,  2588,  2596,  2604,  2612,  2619,
23269         2627,  2634,  2642,  2648,  2656,  2664,  2671,  2679,  2685,  2693,
23270         2701,  2709,  2717,  2725,  2733,  2739,  2747,  2753,  2761,  2769,
23271 
23272        /* 701-800 */
23273         2777,  2785,  2793,  2801,  2809,  2817,  2825,  2833,  2841,  2848,
23274         2856,  2864,  2872,  2878,  2884,  2892,  2898,  2906,  2914,  2922,
23275         2930,  2938,  2944,  2952,  2958,  2966,  2974,  2982,  2988,  2996,
23276         3001,  3009,  3017,  3025,  3032,  3039,  3045,  3052,  3059,  3067,
23277         3069,  3076,  3083,  3090,  3098,  3105,  3109,  3111,  3113,  3120,
23278         3124,  3128,  3132,  3136,  3140,  3144,  3146,  3150,  3158,  3161,
23279         3165,  3166,  3168,  3172,  3176,  3180,  3182,  3185,  3189,  3193,
23280         3194,  3197,  3200,  3204,  3208,  3212,  3216,  3219,  3221,  3222,
23281         3226,  3230,  3234,  3238,  3242,  3243,  3247,  3251,  3254,  3258,
23282         3262,  3266,  3270,  3274,  3275,  3279,  3283,  3287,  3289,  3293,
23283 
23284        /* 801-900 */
23285         3296,  3300,  3303,  3307,  3311,  3315,  3319,  3321,  3324,  3327,
23286         3330,  3334,  3338,  3340,  3342,  3346,  3350,  3354,  3358,  3361,
23287         3365,  3369,  3373,  3377,  3381,  3385,  3389,  3393,  3394,  3398,
23288         3402,  3406,  3410,  3413,  3417,  3421,  3425,  3429,  3433,  3435,
23289         3439,  3443,  3446,  3450,  3453,  3457,  3458,  3461,  3464,  3468,
23290         3472,  3476,  3478,  3481,  3485,  3489,  3493,  3497,  3501,  3505,
23291         3507,  3511,  3514,  3517,  3521,  3524,  3525,  3527,  3529,  3533,
23292         3536,  3540,  3541,  3545,  3548,  3551,  3555,  3559,  3563,  3567,
23293         3569,  3570,  3574,  3576,  3578,  3582,  3586,  3590,  3593,  3596,
23294         3600,  3604,  3608,  3612,  3616,  3620,  3623,  3626,  3630,  3632,
23295 
23296        /* 901-1000 */
23297         3636,  3640,  3643,  3646,  3648,  3652,  3656,  3660,  3664,  3667,
23298         3669,  3671,  3675,  3679,  3683,  3687,  3689,  3693,  3694,  3695,
23299         3699,  3703,  3705,  3707,  3710,  3713,  3717,  3721,  3725,  3729,
23300         3733,  3736,  3740,  3744,  3748,  3752,  3754,  3757,  3759,  3763,
23301         3767,  3770,  3773,  3777,  3779,  3783,  3786,  3790,  3794,  3798,
23302         3801,  3805,  3809,  3813,  3817,  3821,  3825,  3827,  3831,  3835,
23303         3836,  3837,  3840,  3844,  3848,  3852,  3856,  3859,  3863,  3867,
23304         3869,  3871,  3875,  3879,  3883,  3887,  3890,  3894,  3898,  3901,
23305         3905,  3909,  3913,  3917,  3921,  3922,  3923,  3924,  3926,  3930,
23306         3932,  3936,  3938,  3940,  3944,  3948,  3952,  3956,  3959,  3963,
23307 
23308        /* 1001-1100 */
23309         3965,  3969,  3973,  3977,  3979,  3981,  3982,  3986,  3989,  3993,
23310         3997,  4001,  4004,  4006,  4009,  4012,  4016,  4020,  4024,  4026,
23311         4028,  4032,  4036,  4040,  4044,  4046,  4050,  4054,  4058,  4060,
23312         4062,  4063,  4064,  4068,  4071,  4075,  4077,  4081,  4083,  4087,
23313         4089,  4091,  4095,  4099,  4101,  4103,  4105,  4107,  4111,  4115,
23314         4119,  4123,  4127,  4129,  4131,  4135,  4139,  4141,  4143,  4145,
23315         4149,  4153,  4157,  4161,  4165,  4169,  4173,  4177,  4180,  4183,
23316         4187,  4191,  4195,  4198,  4201,  4205,  4209,  4212,  4213,  4216,
23317         4217,  4221,  4223,  4226,  4230,  4234,  4236,  4240,  4244,  4248,
23318         4252,  4256,  4258,  4262,  4264,  4266,  4268,  4270,  4272,  4276,
23319 
23320        /* 1101-1200 */
23321         4279,  4283,  4285,  4287,  4289,  4293,  4295,  4299,  4300,  4301,
23322         4305,  4309,  4313,  4317,  4319,  4323,  4325,  4329,  4331,  4333,
23323         4335,  4337,  4341,  4345,  4349,  4351,  4353,  4357,  4361,  4365,
23324         4367,  4369,  4373,  4377,  4381,  4383,  4387,  4389,  4391,  4395,
23325         4399,  4403,  4407,  4411,  4413,  4414,  4415,  4418,  4419,  4421,
23326         4423,  4427,  4429,  4431,  4433,  4435,  4437,  4439,  4443,  4446,
23327         4450,  4452,  4456,  4458,  4460,  4462,  4466,  4469,  4473,  4477,
23328         4481,  4483,  4487,  4489,  4491,  4493,  4497,  4499,  4501,  4504,
23329         4506,  4510,  4513,  4514,  4515,  4518,  4521,  4522,  4525,  4526,
23330         4527,  4530,  4533,  4534,  4537,  4541,  4542,  4543,  4544,  4545,
23331 
23332        /* 1201-1300 */
23333         4546,  4547,  4550,  4553,  4554,  4555,  4558,  4561,  4564,  4567,
23334         4568,  4571,  4574,  4575,  4578,  4581,  4582,  4585,  4586,  4588,
23335         4590,  4592,  4596,  4598,  4602,  4604,  4608,  4612,  4613,  4616,
23336         4619,  4622,  4623,  4624,  4625,  4626,  4629,  4632,  4633,  4636,
23337         4639,  4640,  4641,  4642,  4643,  4644,  4645,  4648,  4649,  4650,
23338         4651,  4652,  4653,  4656,  4657,  4660,  4661,  4664,  4667,  4670,
23339         4671,  4674,  4675,  4676,  4677,  4678,  4681,  4682,  4683,  4684,
23340         4687,  4688,  4689,  4692,  4693,  4696,  4697,  4700,  4701,  4702,
23341         4703,  4704,  4707,  4708,  4711,  4712,  4715,  4716,  4717,  4718,
23342         4719,  4720,  4721,  4722,  4723,  4726,  4729,  4730,  4733,  4736,
23343 
23344        /* 1301-(NFLS+NFPL) */
23345         4737,  4740,  4741,  4742,  4745,  4746,  4749,  4752,  4753
23346        };
23347 
23348     /* Amplitude coefficients (microarcsec);  indexed using the nc array. */
23349        final double a[] = {
23350 
23351        /* 1-105 */
23352              -6844318.44,     9205236.26,1328.67,1538.18,      205833.11,
23353                153041.79,       -3309.73, 853.32,2037.98,       -2301.27,
23354            81.46, 120.56, -20.39, -15.22,   1.73,  -1.61,  -0.10,   0.11,
23355            -0.02,  -0.02,     -523908.04,      573033.42,-544.75,-458.66,
23356                 12814.01,       11714.49, 198.97,-290.91, 155.74,-143.27,
23357            -2.75,  -1.03,  -1.27,  -1.16,   0.00,  -0.01,      -90552.22,
23358                 97846.69, 111.23, 137.41,2187.91,2024.68,  41.44, -51.26,
23359            26.92, -24.46,  -0.46,  -0.28,  -0.22,  -0.20,       82168.76,
23360                -89618.24, -27.64, -29.05,       -2004.36,       -1837.32,
23361           -36.07,  48.00, -24.43,  22.41,   0.47,   0.24,   0.20,   0.18,
23362                 58707.02,7387.02, 470.05,-192.40, 164.33,       -1312.21,
23363          -179.73, -28.93, -17.36,  -1.83,  -0.50,   3.57,   0.00,   0.13,
23364                -20557.78,       22438.42, -20.84, -17.40, 501.82, 459.68,
23365            59.20, -67.30,   6.08,  -5.61,  -1.36,  -1.19,       28288.28,
23366          -674.99, -34.69,  35.80, -15.07,-632.54, -11.19,   0.78,  -8.41,
23367             0.17,   0.01,   0.07,      -15406.85,       20069.50,  15.12,
23368 
23369        /* 106-219 */
23370            31.80, 448.76, 344.50,  -5.77,   1.41,   4.59,  -5.02,   0.17,
23371             0.24,      -11991.74,       12902.66,  32.46,  36.70, 288.49,
23372           268.14,   5.70,  -7.06,   3.57,  -3.23,  -0.06,  -0.04,
23373                 -8584.95,       -9592.72,   4.42, -13.20,-214.50, 192.06,
23374            23.87,  29.83,   2.54,   2.40,   0.60,  -0.48,5095.50,
23375                 -6918.22,   7.19,   3.92,-154.91,-113.94,   2.86,  -1.04,
23376            -1.52,   1.73,  -0.07,  -0.10,       -4910.93,       -5331.13,
23377             0.76,   0.40,-119.21, 109.81,   2.16,   3.20,   1.46,   1.33,
23378             0.04,  -0.02,       -6245.02,-123.48,  -6.68,  -8.20,  -2.76,
23379           139.64,   2.71,   0.15,   1.86,2511.85,       -3323.89,   1.07,
23380            -0.90, -74.33, -56.17,   1.16,  -0.01,  -0.75,   0.83,  -0.02,
23381            -0.04,2307.58,3143.98,  -7.52,   7.50,  70.31, -51.60,   1.46,
23382             0.16,  -0.69,  -0.79,   0.02,  -0.05,2372.58,2554.51,   5.93,
23383            -6.60,  57.12, -53.05,  -0.96,  -1.24,  -0.71,  -0.64,  -0.01,
23384                 -2053.16,2636.13,   5.13,   7.80,  58.94,  45.91,  -0.42,
23385            -0.12,   0.61,  -0.66,   0.02,   0.03,       -1825.49,
23386 
23387        /* 220-339 */
23388                 -2423.59,   1.23,  -2.00, -54.19,  40.82,  -1.07,  -1.02,
23389             0.54,   0.61,  -0.04,   0.04,2521.07,-122.28,  -5.97,   2.90,
23390            -2.73, -56.37,  -0.82,   0.13,  -0.75,       -1534.09,1645.01,
23391             6.29,   6.80,  36.78,  34.30,   0.92,  -1.25,   0.46,  -0.41,
23392            -0.02,  -0.01,1898.27,  47.70,  -0.72,   2.50,   1.07, -42.45,
23393            -0.94,   0.02,  -0.56,       -1292.02,       -1387.00,   0.00,
23394             0.00, -31.01,  28.89,   0.68,   0.00,   0.38,   0.35,  -0.01,
23395            -0.01,       -1234.96,1323.81,   5.21,   5.90,  29.60,  27.61,
23396             0.74,  -1.22,   0.37,  -0.33,  -0.02,  -0.01,1137.48,
23397                 -1233.89,  -0.04,  -0.30, -27.59, -25.43,  -0.61,   1.00,
23398            -0.34,   0.31,   0.01,   0.01,-813.13,       -1075.60,   0.40,
23399             0.30, -24.05,  18.18,  -0.40,  -0.01,   0.24,   0.27,  -0.01,
23400             0.01,1163.22, -60.90,  -2.94,   1.30,  -1.36, -26.01,  -0.58,
23401             0.07,  -0.35,1029.70, -55.55,  -2.63,   1.10,  -1.25, -23.02,
23402            -0.52,   0.06,  -0.31,-556.26, 852.85,   3.16,  -4.48,  19.06,
23403            12.44,  -0.81,  -0.27,   0.17,  -0.21,   0.00,   0.02,-603.52,
23404 
23405        /* 340-467 */
23406          -800.34,   0.44,   0.10, -17.90,  13.49,  -0.08,  -0.01,   0.18,
23407             0.20,  -0.01,   0.01,-628.24, 684.99,  -0.64,  -0.50,  15.32,
23408            14.05,   3.18,  -4.19,   0.19,  -0.17,  -0.09,  -0.07,-866.48,
23409           -16.26,   0.52,  -1.30,  -0.36,  19.37,   0.43,  -0.01,   0.26,
23410          -512.37, 695.54,  -1.47,  -1.40,  15.55,  11.46,  -0.16,   0.03,
23411             0.15,  -0.17,   0.01,   0.01, 506.65, 643.75,   2.54,  -2.62,
23412            14.40, -11.33,  -0.77,  -0.06,  -0.15,  -0.16,   0.00,   0.01,
23413           664.57,  16.81,  -0.40,   1.00,   0.38, -14.86,  -3.71,  -0.09,
23414            -0.20, 405.91, 522.11,   0.99,  -1.50,  11.67,  -9.08,  -0.25,
23415            -0.02,  -0.12,  -0.13,-305.78, 326.60,   1.75,   1.90,   7.30,
23416             6.84,   0.20,  -0.04, 300.99,-325.03,  -0.44,  -0.50,  -7.27,
23417            -6.73,  -1.01,   0.01,   0.00,   0.08,   0.00,   0.02, 438.51,
23418            10.47,  -0.56,  -0.20,   0.24,  -9.81,  -0.24,   0.01,  -0.13,
23419          -264.02, 335.24,   0.99,   1.40,   7.49,   5.90,  -0.27,  -0.02,
23420           284.09, 307.03,   0.32,  -0.40,   6.87,  -6.35,  -0.99,  -0.01,
23421          -250.54, 327.11,   0.08,   0.40,   7.31,   5.60,  -0.30, 230.72,
23422 
23423        /* 468-595 */
23424          -304.46,   0.08,  -0.10,  -6.81,  -5.16,   0.27, 229.78, 304.17,
23425            -0.60,   0.50,   6.80,  -5.14,   0.33,   0.01, 256.30,-276.81,
23426            -0.28,  -0.40,  -6.19,  -5.73,  -0.14,   0.01,-212.82, 269.45,
23427             0.84,   1.20,   6.02,   4.76,   0.14,  -0.02, 196.64, 272.05,
23428            -0.84,   0.90,   6.08,  -4.40,   0.35,   0.02, 188.95, 272.22,
23429            -0.12,   0.30,   6.09,  -4.22,   0.34,-292.37,  -5.10,  -0.32,
23430            -0.40,  -0.11,   6.54,   0.14,   0.01, 161.79,-220.67,   0.24,
23431             0.10,  -4.93,  -3.62,  -0.08, 261.54, -19.94,  -0.95,   0.20,
23432            -0.45,  -5.85,  -0.13,   0.02, 142.16,-190.79,   0.20,   0.10,
23433            -4.27,  -3.18,  -0.07, 187.95,  -4.11,  -0.24,   0.30,  -0.09,
23434            -4.20,  -0.09,   0.01,   0.00,   0.00, -79.08, 167.90,   0.04,
23435             0.00,   3.75,   1.77, 121.98, 131.04,  -0.08,   0.10,   2.93,
23436            -2.73,  -0.06,-172.95,  -8.11,  -0.40,  -0.20,  -0.18,   3.87,
23437             0.09,   0.01,-160.15, -55.30, -14.04,  13.90,  -1.23,   3.58,
23438             0.40,   0.31,-115.40, 123.20,   0.60,   0.70,   2.75,   2.58,
23439             0.08,  -0.01,-168.26,  -2.00,   0.20,  -0.20,  -0.04,   3.76,
23440 
23441        /* 596-723 */
23442             0.08,-114.49, 123.20,   0.32,   0.40,   2.75,   2.56,   0.07,
23443            -0.01, 112.14, 120.70,   0.28,  -0.30,   2.70,  -2.51,  -0.07,
23444            -0.01, 161.34,   4.03,   0.20,   0.20,   0.09,  -3.61,  -0.08,
23445            91.31, 126.64,  -0.40,   0.40,   2.83,  -2.04,  -0.04,   0.01,
23446           105.29, 112.90,   0.44,  -0.50,   2.52,  -2.35,  -0.07,  -0.01,
23447            98.69,-106.20,  -0.28,  -0.30,  -2.37,  -2.21,  -0.06,   0.01,
23448            86.74,-112.94,  -0.08,  -0.20,  -2.53,  -1.94,  -0.05,-134.81,
23449             3.51,   0.20,  -0.20,   0.08,   3.01,   0.07,  79.03, 107.31,
23450            -0.24,   0.20,   2.40,  -1.77,  -0.04,   0.01, 132.81, -10.77,
23451            -0.52,   0.10,  -0.24,  -2.97,  -0.07,   0.01,-130.31,  -0.90,
23452             0.04,   0.00,   0.00,   2.91, -78.56,  85.32,   0.00,   0.00,
23453             1.91,   1.76,   0.04,   0.00,   0.00, -41.53,  89.10,   0.02,
23454             0.00,   1.99,   0.93,  66.03, -71.00,  -0.20,  -0.20,  -1.59,
23455            -1.48,  -0.04,  60.50,  64.70,   0.36,  -0.40,   1.45,  -1.35,
23456            -0.04,  -0.01, -52.27, -70.01,   0.00,   0.00,  -1.57,   1.17,
23457             0.03, -52.95,  66.29,   0.32,   0.40,   1.48,   1.18,   0.04,
23458 
23459        /* 724-851 */
23460            -0.01,  51.02,  67.25,   0.00,   0.00,   1.50,  -1.14,  -0.03,
23461           -55.66, -60.92,   0.16,  -0.20,  -1.36,   1.24,   0.03, -54.81,
23462           -59.20,  -0.08,   0.20,  -1.32,   1.23,   0.03,  51.32, -55.60,
23463             0.00,   0.00,  -1.24,  -1.15,  -0.03,  48.29,  51.80,   0.20,
23464            -0.20,   1.16,  -1.08,  -0.03, -45.59, -49.00,  -0.12,   0.10,
23465            -1.10,   1.02,   0.03,  40.54, -52.69,  -0.04,  -0.10,  -1.18,
23466            -0.91,  -0.02, -40.58, -49.51,  -1.00,   1.00,  -1.11,   0.91,
23467             0.04,   0.02, -43.76,  46.50,   0.36,   0.40,   1.04,   0.98,
23468             0.03,  -0.01,  62.65,  -5.00,  -0.24,   0.00,  -0.11,  -1.40,
23469            -0.03,   0.01, -38.57,  49.59,   0.08,   0.10,   1.11,   0.86,
23470             0.02, -33.22, -44.04,   0.08,  -0.10,  -0.98,   0.74,   0.02,
23471            37.15, -39.90,  -0.12,  -0.10,  -0.89,  -0.83,  -0.02,  36.68,
23472           -39.50,  -0.04,  -0.10,  -0.88,  -0.82,  -0.02, -53.22,  -3.91,
23473            -0.20,   0.00,  -0.09,   1.19,   0.03,  32.43, -42.19,  -0.04,
23474            -0.10,  -0.94,  -0.73,  -0.02, -51.00,  -2.30,  -0.12,  -0.10,
23475             0.00,   1.14, -29.53, -39.11,   0.04,   0.00,  -0.87,   0.66,
23476 
23477        /* 852-979 */
23478             0.02,  28.50, -38.92,  -0.08,  -0.10,  -0.87,  -0.64,  -0.02,
23479            26.54,  36.95,  -0.12,   0.10,   0.83,  -0.59,  -0.01,  26.54,
23480            34.59,   0.04,  -0.10,   0.77,  -0.59,  -0.02,  28.35, -32.55,
23481            -0.16,   0.20,  -0.73,  -0.63,  -0.01, -28.00,  30.40,   0.00,
23482             0.00,   0.68,   0.63,   0.01, -27.61,  29.40,   0.20,   0.20,
23483             0.66,   0.62,   0.02,  40.33,   0.40,  -0.04,   0.10,   0.00,
23484            -0.90, -23.28,  31.61,  -0.08,  -0.10,   0.71,   0.52,   0.01,
23485            37.75,   0.80,   0.04,   0.10,   0.00,  -0.84,  23.66,  25.80,
23486             0.00,   0.00,   0.58,  -0.53,  -0.01,  21.01, -27.91,   0.00,
23487             0.00,  -0.62,  -0.47,  -0.01, -34.81,   2.89,   0.04,   0.00,
23488             0.00,   0.78, -23.49, -25.31,   0.00,   0.00,  -0.57,   0.53,
23489             0.01, -23.47,  25.20,   0.16,   0.20,   0.56,   0.52,   0.02,
23490            19.58,  27.50,  -0.12,   0.10,   0.62,  -0.44,  -0.01, -22.67,
23491           -24.40,  -0.08,   0.10,  -0.55,   0.51,   0.01, -19.97,  25.00,
23492             0.12,   0.20,   0.56,   0.45,   0.01,  21.28, -22.80,  -0.08,
23493            -0.10,  -0.51,  -0.48,  -0.01, -30.47,   0.91,   0.04,   0.00,
23494 
23495        /* 980-1107 */
23496             0.00,   0.68,  18.58,  24.00,   0.04,  -0.10,   0.54,  -0.42,
23497            -0.01, -18.02,  24.40,  -0.04,  -0.10,   0.55,   0.40,   0.01,
23498            17.74,  22.50,   0.08,  -0.10,   0.50,  -0.40,  -0.01, -19.41,
23499            20.70,   0.08,   0.10,   0.46,   0.43,   0.01, -18.64,  20.11,
23500             0.00,   0.00,   0.45,   0.42,   0.01, -16.75,  21.60,   0.04,
23501             0.10,   0.48,   0.37,   0.01, -18.42, -20.00,   0.00,   0.00,
23502            -0.45,   0.41,   0.01, -26.77,   1.41,   0.08,   0.00,   0.00,
23503             0.60, -26.17,  -0.19,   0.00,   0.00,   0.00,   0.59, -15.52,
23504            20.51,   0.00,   0.00,   0.46,   0.35,   0.01, -25.42,  -1.91,
23505            -0.08,   0.00,  -0.04,   0.57,   0.45, -17.42,  18.10,   0.00,
23506             0.00,   0.40,   0.39,   0.01,  16.39, -17.60,  -0.08,  -0.10,
23507            -0.39,  -0.37,  -0.01, -14.37,  18.91,   0.00,   0.00,   0.42,
23508             0.32,   0.01,  23.39,  -2.40,  -0.12,   0.00,   0.00,  -0.52,
23509            14.32, -18.50,  -0.04,  -0.10,  -0.41,  -0.32,  -0.01,  15.69,
23510            17.08,   0.00,   0.00,   0.38,  -0.35,  -0.01, -22.99,   0.50,
23511             0.04,   0.00,   0.00,   0.51,   0.00,   0.00,  14.47, -17.60,
23512 
23513        /* 1108-1235 */
23514            -0.01,   0.00,  -0.39,  -0.32, -13.33,  18.40,  -0.04,  -0.10,
23515             0.41,   0.30,  22.47,  -0.60,  -0.04,   0.00,   0.00,  -0.50,
23516           -12.78, -17.41,   0.04,   0.00,  -0.39,   0.29,   0.01, -14.10,
23517           -15.31,   0.04,   0.00,  -0.34,   0.32,   0.01,  11.98,  16.21,
23518            -0.04,   0.00,   0.36,  -0.27,  -0.01,  19.65,  -1.90,  -0.08,
23519             0.00,   0.00,  -0.44,  19.61,  -1.50,  -0.08,   0.00,   0.00,
23520            -0.44,  13.41, -14.30,  -0.04,  -0.10,  -0.32,  -0.30,  -0.01,
23521           -13.29,  14.40,   0.00,   0.00,   0.32,   0.30,   0.01,  11.14,
23522           -14.40,  -0.04,   0.00,  -0.32,  -0.25,  -0.01,  12.24, -13.38,
23523             0.04,   0.00,  -0.30,  -0.27,  -0.01,  10.07, -13.81,   0.04,
23524             0.00,  -0.31,  -0.23,  -0.01,  10.46,  13.10,   0.08,  -0.10,
23525             0.29,  -0.23,  -0.01,  16.55,  -1.71,  -0.08,   0.00,   0.00,
23526            -0.37,   9.75, -12.80,   0.00,   0.00,  -0.29,  -0.22,  -0.01,
23527             9.11,  12.80,   0.00,   0.00,   0.29,  -0.20,   0.00,   0.00,
23528            -6.44, -13.80,   0.00,   0.00,  -0.31,   0.14,  -9.19, -12.00,
23529             0.00,   0.00,  -0.27,   0.21, -10.30,  10.90,   0.08,   0.10,
23530 
23531        /* 1236-1363 */
23532             0.24,   0.23,   0.01,  14.92,  -0.80,  -0.04,   0.00,   0.00,
23533            -0.33,  10.02, -10.80,   0.00,   0.00,  -0.24,  -0.22,  -0.01,
23534            -9.75,  10.40,   0.04,   0.00,   0.23,   0.22,   0.01,   9.67,
23535           -10.40,  -0.04,   0.00,  -0.23,  -0.22,  -0.01,  -8.28, -11.20,
23536             0.04,   0.00,  -0.25,   0.19,  13.32,  -1.41,  -0.08,   0.00,
23537             0.00,  -0.30,   8.27,  10.50,   0.04,   0.00,   0.23,  -0.19,
23538             0.00,   0.00,  13.13,   0.00,   0.00,   0.00,   0.00,  -0.29,
23539           -12.93,   0.70,   0.04,   0.00,   0.00,   0.29,   7.91, -10.20,
23540             0.00,   0.00,  -0.23,  -0.18,  -7.84, -10.00,  -0.04,   0.00,
23541            -0.22,   0.18,   7.44,   9.60,   0.00,   0.00,   0.21,  -0.17,
23542            -7.64,   9.40,   0.08,   0.10,   0.21,   0.17,   0.01, -11.38,
23543             0.60,   0.04,   0.00,   0.00,   0.25,  -7.48,   8.30,   0.00,
23544             0.00,   0.19,   0.17, -10.98,  -0.20,   0.00,   0.00,   0.00,
23545             0.25,  10.98,   0.20,   0.00,   0.00,   0.00,  -0.25,   7.40,
23546            -7.90,  -0.04,   0.00,  -0.18,  -0.17,  -6.09,   8.40,  -0.04,
23547             0.00,   0.19,   0.14,  -6.94,  -7.49,   0.00,   0.00,  -0.17,
23548 
23549        /* 1364-1491 */
23550             0.16,   6.92,   7.50,   0.04,   0.00,   0.17,  -0.15,   6.20,
23551             8.09,   0.00,   0.00,   0.18,  -0.14,  -6.12,   7.80,   0.04,
23552             0.00,   0.17,   0.14,   5.85,  -7.50,   0.00,   0.00,  -0.17,
23553            -0.13,  -6.48,   6.90,   0.08,   0.10,   0.15,   0.14,   0.01,
23554             6.32,   6.90,   0.00,   0.00,   0.15,  -0.14,   5.61,  -7.20,
23555             0.00,   0.00,  -0.16,  -0.13,   9.07,   0.00,   0.00,   0.00,
23556             0.00,  -0.20,   5.25,   6.90,   0.00,   0.00,   0.15,  -0.12,
23557            -8.47,  -0.40,   0.00,   0.00,   0.00,   0.19,   6.32,  -5.39,
23558            -1.11,   1.10,  -0.12,  -0.14,   0.02,   0.02,   5.73,  -6.10,
23559            -0.04,   0.00,  -0.14,  -0.13,   4.70,   6.60,  -0.04,   0.00,
23560             0.15,  -0.11,  -4.90,  -6.40,   0.00,   0.00,  -0.14,   0.11,
23561            -5.33,   5.60,   0.04,   0.10,   0.13,   0.12,   0.01,  -4.81,
23562             6.00,   0.04,   0.00,   0.13,   0.11,   5.13,   5.50,   0.04,
23563             0.00,   0.12,  -0.11,   4.50,   5.90,   0.00,   0.00,   0.13,
23564            -0.10,  -4.22,   6.10,   0.00,   0.00,   0.14,  -4.53,   5.70,
23565             0.00,   0.00,   0.13,   0.10,   4.18,   5.70,   0.00,   0.00,
23566 
23567        /* 1492-1619 */
23568             0.13,  -4.75,  -5.19,   0.00,   0.00,  -0.12,   0.11,  -4.06,
23569             5.60,   0.00,   0.00,   0.13,  -3.98,   5.60,  -0.04,   0.00,
23570             0.13,   4.02,  -5.40,   0.00,   0.00,  -0.12,   4.49,  -4.90,
23571            -0.04,   0.00,  -0.11,  -0.10,  -3.62,  -5.40,  -0.16,   0.20,
23572            -0.12,   0.00,   0.01,   4.38,   4.80,   0.00,   0.00,   0.11,
23573            -6.40,  -0.10,   0.00,   0.00,   0.00,   0.14,  -3.98,   5.00,
23574             0.04,   0.00,   0.11,  -3.82,  -5.00,   0.00,   0.00,  -0.11,
23575            -3.71,   5.07,   0.00,   0.00,   0.11,   4.14,   4.40,   0.00,
23576             0.00,   0.10,  -6.01,  -0.50,  -0.04,   0.00,   0.00,   0.13,
23577            -4.04,   4.39,   0.00,   0.00,   0.10,   3.45,  -4.72,   0.00,
23578             0.00,  -0.11,   3.31,   4.71,   0.00,   0.00,   0.11,   3.26,
23579            -4.50,   0.00,   0.00,  -0.10,  -3.26,  -4.50,   0.00,   0.00,
23580            -0.10,  -3.34,  -4.40,   0.00,   0.00,  -0.10,  -3.74,  -4.00,
23581             3.70,   4.00,   3.34,  -4.30,   3.30,  -4.30,  -3.66,   3.90,
23582             0.04,   3.66,   3.90,   0.04,  -3.62,  -3.90,  -3.61,   3.90,
23583            -0.20,   5.30,   0.00,   0.00,   0.12,   3.06,   4.30,   3.30,
23584 
23585        /* 1620-1747 */
23586             4.00,   0.40,   0.20,   3.10,   4.10,  -3.06,   3.90,  -3.30,
23587            -3.60,  -3.30,   3.36,   0.01,   3.14,   3.40,  -4.57,  -0.20,
23588             0.00,   0.00,   0.00,   0.10,  -2.70,  -3.60,   2.94,  -3.20,
23589            -2.90,   3.20,   2.47,  -3.40,   2.55,  -3.30,   2.80,  -3.08,
23590             2.51,   3.30,  -4.10,   0.30,  -0.12,  -0.10,   4.10,   0.20,
23591            -2.74,   3.00,   2.46,   3.23,  -3.66,   1.20,  -0.20,   0.20,
23592             3.74,  -0.40,  -2.51,  -2.80,  -3.74,   2.27,  -2.90,   0.00,
23593             0.00,  -2.50,   2.70,  -2.51,   2.60,  -3.50,   0.20,   3.38,
23594            -2.22,  -2.50,   3.26,  -0.40,   1.95,  -2.60,   3.22,  -0.40,
23595            -0.04,  -1.79,  -2.60,   1.91,   2.50,   0.74,   3.05,  -0.04,
23596             0.08,   2.11,  -2.30,  -2.11,   2.20,  -1.87,  -2.40,   2.03,
23597            -2.20,  -2.03,   2.20,   2.98,   0.00,   0.00,   2.98,  -1.71,
23598             2.40,   2.94,  -0.10,  -0.12,   0.10,   1.67,   2.40,  -1.79,
23599             2.30,  -1.79,   2.20,  -1.67,   2.20,   1.79,  -2.00,   1.87,
23600            -1.90,   1.63,  -2.10,  -1.59,   2.10,   1.55,  -2.10,  -1.55,
23601             2.10,  -2.59,  -0.20,  -1.75,  -1.90,  -1.75,   1.90,  -1.83,
23602 
23603        /* 1748-1875 */
23604            -1.80,   1.51,   2.00,  -1.51,  -2.00,   1.71,   1.80,   1.31,
23605             2.10,  -1.43,   2.00,   1.43,   2.00,  -2.43,  -1.51,   1.90,
23606            -1.47,   1.90,   2.39,   0.20,  -2.39,   1.39,   1.90,   1.39,
23607            -1.80,   1.47,  -1.60,   1.47,  -1.60,   1.43,  -1.50,  -1.31,
23608             1.60,   1.27,  -1.60,  -1.27,   1.60,   1.27,  -1.60,   2.03,
23609             1.35,   1.50,  -1.39,  -1.40,   1.95,  -0.20,  -1.27,   1.49,
23610             1.19,   1.50,   1.27,   1.40,   1.15,   1.50,   1.87,  -0.10,
23611            -1.12,  -1.50,   1.87,  -1.11,  -1.50,  -1.11,  -1.50,   0.00,
23612             0.00,   1.19,   1.40,   1.27,  -1.30,  -1.27,  -1.30,  -1.15,
23613             1.40,  -1.23,   1.30,  -1.23,  -1.30,   1.22,  -1.29,   1.07,
23614            -1.40,   1.75,  -0.20,  -1.03,  -1.40,  -1.07,   1.20,  -1.03,
23615             1.15,   1.07,   1.10,   1.51,  -1.03,   1.10,   1.03,  -1.10,
23616             0.00,   0.00,  -1.03,  -1.10,   0.91,  -1.20,  -0.88,  -1.20,
23617            -0.88,   1.20,  -0.95,   1.10,  -0.95,  -1.10,   1.43,  -1.39,
23618             0.95,  -1.00,  -0.95,   1.00,  -0.80,   1.10,   0.91,  -1.00,
23619            -1.35,   0.88,   1.00,  -0.83,   1.00,  -0.91,   0.90,   0.91,
23620 
23621        /* 1876-2003 */
23622             0.90,   0.88,  -0.90,  -0.76,  -1.00,  -0.76,   1.00,   0.76,
23623             1.00,  -0.72,   1.00,   0.84,  -0.90,   0.84,   0.90,   1.23,
23624             0.00,   0.00,  -0.52,  -1.10,  -0.68,   1.00,   1.19,  -0.20,
23625             1.19,   0.76,   0.90,   1.15,  -0.10,   1.15,  -0.10,   0.72,
23626            -0.90,  -1.15,  -1.15,   0.68,   0.90,  -0.68,   0.90,  -1.11,
23627             0.00,   0.00,   0.20,   0.79,   0.80,  -1.11,  -0.10,   0.00,
23628             0.00,  -0.48,  -1.00,  -0.76,  -0.80,  -0.72,  -0.80,  -1.07,
23629            -0.10,   0.64,   0.80,  -0.64,  -0.80,   0.64,   0.80,   0.40,
23630             0.60,   0.52,  -0.50,  -0.60,  -0.80,  -0.71,   0.70,  -0.99,
23631             0.99,   0.56,   0.80,  -0.56,   0.80,   0.68,  -0.70,   0.68,
23632             0.70,  -0.95,  -0.64,   0.70,   0.64,   0.70,  -0.60,   0.70,
23633            -0.60,  -0.70,  -0.91,  -0.10,  -0.51,   0.76,  -0.91,  -0.56,
23634             0.70,   0.88,   0.88,  -0.63,  -0.60,   0.55,  -0.60,  -0.80,
23635             0.80,  -0.80,  -0.52,   0.60,   0.52,   0.60,   0.52,  -0.60,
23636            -0.48,   0.60,   0.48,   0.60,   0.48,   0.60,  -0.76,   0.44,
23637            -0.60,   0.52,  -0.50,  -0.52,   0.50,   0.40,   0.60,  -0.40,
23638 
23639        /* 2004-2131 */
23640            -0.60,   0.40,  -0.60,   0.72,  -0.72,  -0.51,  -0.50,  -0.48,
23641             0.50,   0.48,  -0.50,  -0.48,   0.50,  -0.48,   0.50,   0.48,
23642            -0.50,  -0.48,  -0.50,  -0.68,  -0.68,   0.44,   0.50,  -0.64,
23643            -0.10,  -0.64,  -0.10,  -0.40,   0.50,   0.40,   0.50,   0.40,
23644             0.50,   0.00,   0.00,  -0.40,  -0.50,  -0.36,  -0.50,   0.36,
23645            -0.50,   0.60,  -0.60,   0.40,  -0.40,   0.40,   0.40,  -0.40,
23646             0.40,  -0.40,   0.40,  -0.56,  -0.56,   0.36,  -0.40,  -0.36,
23647             0.40,   0.36,  -0.40,  -0.36,  -0.40,   0.36,   0.40,   0.36,
23648             0.40,  -0.52,   0.52,   0.52,   0.32,   0.40,  -0.32,   0.40,
23649            -0.32,   0.40,  -0.32,   0.40,   0.32,  -0.40,  -0.32,  -0.40,
23650             0.32,  -0.40,   0.28,  -0.40,  -0.28,   0.40,   0.28,  -0.40,
23651             0.28,   0.40,   0.48,  -0.48,   0.48,   0.36,  -0.30,  -0.36,
23652            -0.30,   0.00,   0.00,   0.20,   0.40,  -0.44,   0.44,  -0.44,
23653            -0.44,  -0.44,  -0.44,   0.32,  -0.30,   0.32,   0.30,   0.24,
23654             0.30,  -0.12,  -0.10,  -0.28,   0.30,   0.28,   0.30,   0.28,
23655             0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,  -0.30,   0.28,
23656 
23657        /* 2132-2259 */
23658             0.30,  -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.24,
23659            -0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,   0.30,   0.24,
23660            -0.30,  -0.24,   0.30,   0.24,  -0.30,  -0.24,  -0.30,   0.24,
23661            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,   0.20,
23662            -0.30,   0.20,  -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,
23663            -0.30,   0.20,  -0.30,   0.20,   0.30,   0.20,   0.30,  -0.20,
23664            -0.30,   0.20,  -0.30,   0.20,  -0.30,  -0.36,  -0.36,  -0.36,
23665            -0.04,   0.30,   0.12,  -0.10,  -0.32,  -0.24,   0.20,   0.24,
23666             0.20,   0.20,  -0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.20,
23667             0.20,   0.20,  -0.20,   0.20,   0.20,   0.20,   0.20,  -0.20,
23668            -0.20,   0.00,   0.00,  -0.20,  -0.20,  -0.20,   0.20,  -0.20,
23669             0.20,   0.20,  -0.20,  -0.20,  -0.20,   0.20,   0.20,   0.20,
23670             0.20,   0.20,  -0.20,   0.20,  -0.20,   0.28,   0.28,   0.28,
23671             0.28,   0.28,   0.28,  -0.28,   0.28,   0.12,   0.00,   0.24,
23672             0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,
23673            -0.16,   0.20,   0.16,   0.20,  -0.16,   0.20,  -0.16,   0.20,
23674 
23675        /* 2260-2387 */
23676            -0.16,   0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,  -0.20,
23677            -0.16,   0.20,  -0.16,  -0.20,  -0.16,   0.20,   0.16,   0.20,
23678             0.16,  -0.20,   0.16,  -0.20,   0.16,   0.20,   0.16,   0.20,
23679             0.16,   0.20,  -0.16,  -0.20,   0.16,   0.20,  -0.16,   0.20,
23680             0.16,   0.20,  -0.16,  -0.20,   0.16,  -0.20,   0.16,  -0.20,
23681            -0.16,  -0.20,   0.24,  -0.24,  -0.24,   0.24,   0.24,   0.12,
23682             0.20,   0.12,   0.20,  -0.12,  -0.20,   0.12,  -0.20,   0.12,
23683            -0.20,  -0.12,   0.20,  -0.12,   0.20,  -0.12,  -0.20,   0.12,
23684             0.20,   0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23685            -0.20,  -0.12,   0.20,   0.12,   0.20,   0.00,   0.00,  -0.12,
23686             0.20,  -0.12,   0.20,   0.12,  -0.20,  -0.12,   0.20,   0.12,
23687             0.20,   0.00,  -0.21,  -0.20,   0.00,   0.00,   0.20,  -0.20,
23688            -0.20,  -0.20,   0.20,  -0.16,  -0.10,   0.00,   0.17,   0.16,
23689             0.16,   0.16,   0.16,  -0.16,   0.16,   0.16,  -0.16,   0.16,
23690            -0.16,   0.16,   0.12,   0.10,   0.12,  -0.10,  -0.12,   0.10,
23691            -0.12,   0.10,   0.12,  -0.10,  -0.12,   0.12,  -0.12,   0.12,
23692 
23693        /* 2388-2515 */
23694            -0.12,   0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,  -0.12,
23695            -0.12,   0.12,   0.12,   0.12,   0.12,  -0.12,  -0.12,   0.12,
23696             0.12,   0.12,  -0.12,   0.12,  -0.12,  -0.12,  -0.12,   0.12,
23697            -0.12,  -0.12,   0.12,   0.00,   0.11,   0.11,-122.67, 164.70,
23698           203.78, 273.50,   3.58,   2.74,   6.18,  -4.56,   0.00,  -0.04,
23699             0.00,  -0.07,  57.44, -77.10,  95.82, 128.60,  -1.77,  -1.28,
23700             2.85,  -2.14,  82.14,  89.50,   0.00,   0.00,   2.00,  -1.84,
23701            -0.04,  47.73, -64.10,  23.79,  31.90,  -1.45,  -1.07,   0.69,
23702            -0.53, -46.38,  50.50,   0.00,   0.00,   1.13,   1.04,   0.02,
23703           -18.38,   0.00,  63.80,   0.00,   0.00,   0.41,   0.00,  -1.43,
23704            59.07,   0.00,   0.00,   0.00,   0.00,  -1.32,  57.28,   0.00,
23705             0.00,   0.00,   0.00,  -1.28, -48.65,   0.00,  -1.15,   0.00,
23706             0.00,   1.09,   0.00,   0.03, -18.30,  24.60, -17.30, -23.20,
23707             0.56,   0.41,  -0.51,   0.39, -16.91,  26.90,   8.43,  13.30,
23708             0.60,   0.38,   0.31,  -0.19,   1.23,  -1.70, -19.13, -25.70,
23709            -0.03,  -0.03,  -0.58,   0.43,  -0.72,   0.90, -17.34, -23.30,
23710 
23711        /* 2516-2643 */
23712             0.03,   0.02,  -0.52,   0.39, -19.49, -21.30,   0.00,   0.00,
23713            -0.48,   0.44,   0.01,  20.57, -20.10,   0.64,   0.70,  -0.45,
23714            -0.46,   0.00,  -0.01,   4.89,   5.90, -16.55,  19.90,   0.14,
23715            -0.11,   0.44,   0.37,  18.22,  19.80,   0.00,   0.00,   0.44,
23716            -0.41,  -0.01,   4.89,  -5.30, -16.51, -18.00,  -0.11,  -0.11,
23717            -0.41,   0.37, -17.86,   0.00,  17.10,   0.00,   0.00,   0.40,
23718             0.00,  -0.38,   0.32,   0.00,  24.42,   0.00,   0.00,  -0.01,
23719             0.00,  -0.55, -23.79,   0.00,   0.00,   0.00,   0.00,   0.53,
23720            14.72, -16.00,  -0.32,   0.00,  -0.36,  -0.33,  -0.01,   0.01,
23721             3.34,  -4.50,  11.86,  15.90,  -0.11,  -0.07,   0.35,  -0.27,
23722            -3.26,   4.40,  11.62,  15.60,   0.09,   0.07,   0.35,  -0.26,
23723           -19.53,   0.00,   5.09,   0.00,   0.00,   0.44,   0.00,  -0.11,
23724           -13.48,  14.70,   0.00,   0.00,   0.33,   0.30,   0.01,  10.86,
23725           -14.60,   3.18,   4.30,  -0.33,  -0.24,   0.09,  -0.07, -11.30,
23726           -15.10,   0.00,   0.00,  -0.34,   0.25,   0.01,   2.03,  -2.70,
23727            10.82,  14.50,  -0.07,  -0.05,   0.32,  -0.24,  17.46,   0.00,
23728 
23729        /* 2644-2771 */
23730             0.00,   0.00,   0.00,  -0.39,  16.43,   0.00,   0.52,   0.00,
23731             0.00,  -0.37,   0.00,  -0.01,   9.35,   0.00,  13.29,   0.00,
23732             0.00,  -0.21,   0.00,  -0.30, -10.42,  11.40,   0.00,   0.00,
23733             0.25,   0.23,   0.01,   0.44,   0.50, -10.38,  11.30,   0.02,
23734            -0.01,   0.25,   0.23, -14.64,   0.00,   0.00,   0.00,   0.00,
23735             0.33,   0.56,   0.80,  -8.67,  11.70,   0.02,  -0.01,   0.26,
23736             0.19,  13.88,   0.00,  -2.47,   0.00,   0.00,  -0.31,   0.00,
23737             0.06,  -1.99,   2.70,   7.72,  10.30,   0.06,   0.04,   0.23,
23738            -0.17,  -0.20,   0.00,  13.05,   0.00,   0.00,   0.00,   0.00,
23739            -0.29,   6.92,  -9.30,   3.34,   4.50,  -0.21,  -0.15,   0.10,
23740            -0.07,  -6.60,   0.00,  10.70,   0.00,   0.00,   0.15,   0.00,
23741            -0.24,  -8.04,  -8.70,   0.00,   0.00,  -0.19,   0.18, -10.58,
23742             0.00,  -3.10,   0.00,   0.00,   0.24,   0.00,   0.07,  -7.32,
23743             8.00,  -0.12,  -0.10,   0.18,   0.16,   1.63,   1.70,   6.96,
23744            -7.60,   0.03,  -0.04,  -0.17,  -0.16,  -3.62,   0.00,   9.86,
23745             0.00,   0.00,   0.08,   0.00,  -0.22,   0.20,  -0.20,  -6.88,
23746 
23747        /* 2772-2899 */
23748            -7.50,   0.00,   0.00,  -0.17,   0.15,  -8.99,   0.00,   4.02,
23749             0.00,   0.00,   0.20,   0.00,  -0.09,  -1.07,   1.40,  -5.69,
23750            -7.70,   0.03,   0.02,  -0.17,   0.13,   6.48,  -7.20,  -0.48,
23751            -0.50,  -0.16,  -0.14,  -0.01,   0.01,   5.57,  -7.50,   1.07,
23752             1.40,  -0.17,  -0.12,   0.03,  -0.02,   8.71,   0.00,   3.54,
23753             0.00,   0.00,  -0.19,   0.00,  -0.08,   0.40,   0.00,   9.27,
23754             0.00,   0.00,  -0.01,   0.00,  -0.21,  -6.13,   6.70,  -1.19,
23755            -1.30,   0.15,   0.14,  -0.03,   0.03,   5.21,  -5.70,  -2.51,
23756            -2.60,  -0.13,  -0.12,  -0.06,   0.06,   5.69,  -6.20,  -0.12,
23757            -0.10,  -0.14,  -0.13,  -0.01,   2.03,  -2.70,   4.53,   6.10,
23758            -0.06,  -0.05,   0.14,  -0.10,   5.01,   5.50,  -2.51,   2.70,
23759             0.12,  -0.11,   0.06,   0.06,  -1.91,   2.60,  -4.38,  -5.90,
23760             0.06,   0.04,  -0.13,   0.10,   4.65,  -6.30,   0.00,   0.00,
23761            -0.14,  -0.10,  -5.29,   5.70,   0.00,   0.00,   0.13,   0.12,
23762            -2.23,  -4.00,  -4.65,   4.20,  -0.09,   0.05,   0.10,   0.10,
23763            -4.53,   6.10,   0.00,   0.00,   0.14,   0.10,   2.47,   2.70,
23764 
23765        /* 2900-3027 */
23766            -4.46,   4.90,   0.06,  -0.06,   0.11,   0.10,  -5.05,   5.50,
23767             0.84,   0.90,   0.12,   0.11,   0.02,  -0.02,   4.97,  -5.40,
23768            -1.71,   0.00,  -0.12,  -0.11,   0.00,   0.04,  -0.99,  -1.30,
23769             4.22,  -5.70,  -0.03,   0.02,  -0.13,  -0.09,   0.99,   1.40,
23770             4.22,  -5.60,   0.03,  -0.02,  -0.13,  -0.09,  -4.69,  -5.20,
23771             0.00,   0.00,  -0.12,   0.10,  -3.42,   0.00,   6.09,   0.00,
23772             0.00,   0.08,   0.00,  -0.14,  -4.65,  -5.10,   0.00,   0.00,
23773            -0.11,   0.10,   0.00,   0.00,  -4.53,  -5.00,   0.00,   0.00,
23774            -0.11,   0.10,  -2.43,  -2.70,  -3.82,   4.20,  -0.06,   0.05,
23775             0.10,   0.09,   0.00,   0.00,  -4.53,   4.90,   0.00,   0.00,
23776             0.11,   0.10,  -4.49,  -4.90,   0.00,   0.00,  -0.11,   0.10,
23777             2.67,  -2.90,  -3.62,  -3.90,  -0.06,  -0.06,  -0.09,   0.08,
23778             3.94,  -5.30,   0.00,   0.00,  -0.12,  -3.38,   3.70,  -2.78,
23779            -3.10,   0.08,   0.08,  -0.07,   0.06,   3.18,  -3.50,  -2.82,
23780            -3.10,  -0.08,  -0.07,  -0.07,   0.06,  -5.77,   0.00,   1.87,
23781             0.00,   0.00,   0.13,   0.00,  -0.04,   3.54,  -4.80,  -0.64,
23782 
23783        /* 3028-3155 */
23784            -0.90,  -0.11,   0.00,  -0.02,  -3.50,  -4.70,   0.68,  -0.90,
23785            -0.11,   0.00,  -0.02,   5.49,   0.00,   0.00,   0.00,   0.00,
23786            -0.12,   1.83,  -2.50,   2.63,   3.50,  -0.06,   0.00,   0.08,
23787             3.02,  -4.10,   0.68,   0.90,  -0.09,   0.00,   0.02,   0.00,
23788             0.00,   5.21,   0.00,   0.00,   0.00,   0.00,  -0.12,  -3.54,
23789             3.80,   2.70,   3.60,  -1.35,   1.80,   0.08,   0.00,   0.04,
23790            -2.90,   3.90,   0.68,   0.90,   0.09,   0.00,   0.02,   0.80,
23791            -1.10,  -2.78,  -3.70,  -0.02,   0.00,  -0.08,   4.10,   0.00,
23792            -2.39,   0.00,   0.00,  -0.09,   0.00,   0.05,  -1.59,   2.10,
23793             2.27,   3.00,   0.05,   0.00,   0.07,  -2.63,   3.50,  -0.48,
23794            -0.60,  -2.94,  -3.20,  -2.94,   3.20,   2.27,  -3.00,  -1.11,
23795            -1.50,  -0.07,   0.00,  -0.03,  -0.56,  -0.80,  -2.35,   3.10,
23796             0.00,  -0.60,  -3.42,   1.90,  -0.12,  -0.10,   2.63,  -2.90,
23797             2.51,   2.80,  -0.64,   0.70,  -0.48,  -0.60,   2.19,  -2.90,
23798             0.24,  -0.30,   2.15,   2.90,   2.15,  -2.90,   0.52,   0.70,
23799             2.07,  -2.80,  -3.10,   0.00,   1.79,   0.00,   0.00,   0.07,
23800 
23801        /* 3156-3283 */
23802             0.00,  -0.04,   0.88,   0.00,  -3.46,   2.11,   2.80,  -0.36,
23803             0.50,   3.54,  -0.20,  -3.50,  -1.39,   1.50,  -1.91,  -2.10,
23804            -1.47,   2.00,   1.39,   1.90,   2.07,  -2.30,   0.91,   1.00,
23805             1.99,  -2.70,   3.30,   0.00,   0.60,  -0.44,  -0.70,  -1.95,
23806             2.60,   2.15,  -2.40,  -0.60,  -0.70,   3.30,   0.84,   0.00,
23807            -3.10,  -3.10,   0.00,  -0.72,  -0.32,   0.40,  -1.87,  -2.50,
23808             1.87,  -2.50,   0.32,   0.40,  -0.24,   0.30,  -1.87,  -2.50,
23809            -0.24,  -0.30,   1.87,  -2.50,  -2.70,   0.00,   1.55,   2.03,
23810             2.20,  -2.98,  -1.99,  -2.20,   0.12,  -0.10,  -0.40,   0.50,
23811             1.59,   2.10,   0.00,   0.00,  -1.79,   2.00,  -1.03,   1.40,
23812            -1.15,  -1.60,   0.32,   0.50,   1.39,  -1.90,   2.35,  -1.27,
23813             1.70,   0.60,   0.80,  -0.32,  -0.40,   1.35,  -1.80,   0.44,
23814             0.00,   2.23,  -0.84,   0.90,  -1.27,  -1.40,  -1.47,   1.60,
23815            -0.28,  -0.30,  -0.28,   0.40,  -1.27,  -1.70,   0.28,  -0.40,
23816            -1.43,  -1.50,   0.00,   0.00,  -1.27,  -1.70,   2.11,  -0.32,
23817            -0.40,  -1.23,   1.60,   1.19,  -1.30,  -0.72,  -0.80,   0.72,
23818 
23819        /* 3284-3411 */
23820            -0.80,  -1.15,  -1.30,  -1.35,  -1.50,  -1.19,  -1.60,  -0.12,
23821             0.20,   1.79,   0.00,  -0.88,  -0.28,   0.40,   1.11,   1.50,
23822            -1.83,   0.00,   0.56,  -0.12,   0.10,  -1.27,  -1.40,   0.00,
23823             0.00,   1.15,   1.50,  -0.12,   0.20,   1.11,   1.50,   0.36,
23824            -0.50,  -1.07,  -1.40,  -1.11,   1.50,   1.67,   0.00,   0.80,
23825            -1.11,   0.00,   1.43,   1.23,  -1.30,  -0.24,  -1.19,  -1.30,
23826            -0.24,   0.20,  -0.44,  -0.90,  -0.95,   1.10,   1.07,  -1.40,
23827             1.15,  -1.30,   1.03,  -1.10,  -0.56,  -0.60,  -0.68,   0.90,
23828            -0.76,  -1.00,  -0.24,  -0.30,   0.95,  -1.30,   0.56,   0.70,
23829             0.84,  -1.10,  -0.56,   0.00,  -1.55,   0.91,  -1.30,   0.28,
23830             0.30,   0.16,  -0.20,   0.95,   1.30,   0.40,  -0.50,  -0.88,
23831            -1.20,   0.95,  -1.10,  -0.48,  -0.50,   0.00,   0.00,  -1.07,
23832             1.20,   0.44,  -0.50,   0.95,   1.10,   0.00,   0.00,   0.92,
23833            -1.30,   0.95,   1.00,  -0.52,   0.60,   1.59,   0.24,  -0.40,
23834             0.91,   1.20,   0.84,  -1.10,  -0.44,  -0.60,   0.84,   1.10,
23835            -0.44,   0.60,  -0.44,   0.60,  -0.84,  -1.10,  -0.80,   0.00,
23836 
23837        /* 3412-3539 */
23838             1.35,   0.76,   0.20,  -0.91,  -1.00,   0.20,  -0.30,  -0.91,
23839            -1.20,  -0.95,   1.00,  -0.48,  -0.50,   0.88,   1.00,   0.48,
23840            -0.50,  -0.95,  -1.10,   0.20,  -0.20,  -0.99,   1.10,  -0.84,
23841             1.10,  -0.24,  -0.30,   0.20,  -0.30,   0.84,   1.10,  -1.39,
23842             0.00,  -0.28,  -0.16,   0.20,   0.84,   1.10,   0.00,   0.00,
23843             1.39,   0.00,   0.00,  -0.95,   1.00,   1.35,  -0.99,   0.00,
23844             0.88,  -0.52,   0.00,  -1.19,   0.20,   0.20,   0.76,  -1.00,
23845             0.00,   0.00,   0.76,   1.00,   0.00,   0.00,   0.76,   1.00,
23846            -0.76,   1.00,   0.00,   0.00,   1.23,   0.76,   0.80,  -0.32,
23847             0.40,  -0.72,   0.80,  -0.40,  -0.40,   0.00,   0.00,  -0.80,
23848            -0.90,  -0.68,   0.90,  -0.16,  -0.20,  -0.16,  -0.20,   0.68,
23849            -0.90,  -0.36,   0.50,  -0.56,  -0.80,   0.72,  -0.90,   0.44,
23850            -0.60,  -0.48,  -0.70,  -0.16,   0.00,  -1.11,   0.32,   0.00,
23851            -1.07,   0.60,  -0.80,  -0.28,  -0.40,  -0.64,   0.00,   0.91,
23852             1.11,   0.64,  -0.90,   0.76,  -0.80,   0.00,   0.00,  -0.76,
23853            -0.80,   1.03,   0.00,  -0.36,  -0.64,  -0.70,   0.36,  -0.40,
23854 
23855        /* 3540-3667 */
23856             1.07,   0.36,  -0.50,  -0.52,  -0.70,   0.60,   0.00,   0.88,
23857             0.95,   0.00,   0.48,   0.16,  -0.20,   0.60,   0.80,   0.16,
23858            -0.20,  -0.60,  -0.80,   0.00,  -1.00,   0.12,   0.20,   0.16,
23859            -0.20,   0.68,   0.70,   0.59,  -0.80,  -0.99,  -0.56,  -0.60,
23860             0.36,  -0.40,  -0.68,  -0.70,  -0.68,  -0.70,  -0.36,  -0.50,
23861            -0.44,   0.60,   0.64,   0.70,  -0.12,   0.10,  -0.52,   0.60,
23862             0.36,   0.40,   0.00,   0.00,   0.95,  -0.84,   0.00,   0.44,
23863             0.56,   0.60,   0.32,  -0.30,   0.00,   0.00,   0.60,   0.70,
23864             0.00,   0.00,   0.60,   0.70,  -0.12,  -0.20,   0.52,  -0.70,
23865             0.00,   0.00,   0.56,   0.70,  -0.12,   0.10,  -0.52,  -0.70,
23866             0.00,   0.00,   0.88,  -0.76,   0.00,  -0.44,   0.00,   0.00,
23867            -0.52,  -0.70,   0.52,  -0.70,   0.36,  -0.40,  -0.44,  -0.50,
23868             0.00,   0.00,   0.60,   0.60,   0.84,   0.00,   0.12,  -0.24,
23869             0.00,   0.80,  -0.56,   0.60,  -0.32,  -0.30,   0.48,  -0.50,
23870             0.28,  -0.30,  -0.48,  -0.50,   0.12,   0.20,   0.48,  -0.60,
23871             0.48,   0.60,  -0.12,   0.20,   0.24,   0.00,   0.76,  -0.52,
23872 
23873        /* 3668-3795 */
23874            -0.60,  -0.52,   0.60,   0.48,  -0.50,  -0.24,  -0.30,   0.12,
23875            -0.10,   0.48,   0.60,   0.52,  -0.20,   0.36,   0.40,  -0.44,
23876             0.50,  -0.24,  -0.30,  -0.48,  -0.60,  -0.44,  -0.60,  -0.12,
23877             0.10,   0.76,   0.76,   0.20,  -0.20,   0.48,   0.50,   0.40,
23878            -0.50,  -0.24,  -0.30,   0.44,  -0.60,   0.44,  -0.60,   0.36,
23879             0.00,  -0.64,   0.72,   0.00,  -0.12,   0.00,  -0.10,  -0.40,
23880            -0.60,  -0.20,  -0.20,  -0.44,   0.50,  -0.44,   0.50,   0.20,
23881             0.20,  -0.44,  -0.50,   0.20,  -0.20,  -0.20,   0.20,  -0.44,
23882            -0.50,   0.64,   0.00,   0.32,  -0.36,   0.50,  -0.20,  -0.30,
23883             0.12,  -0.10,   0.48,   0.50,  -0.12,   0.30,  -0.36,  -0.50,
23884             0.00,   0.00,   0.48,   0.50,  -0.48,   0.50,   0.68,   0.00,
23885            -0.12,   0.56,  -0.40,   0.44,  -0.50,  -0.12,  -0.10,   0.24,
23886             0.30,  -0.40,   0.40,   0.64,   0.00,  -0.24,   0.64,   0.00,
23887            -0.20,   0.00,   0.00,   0.44,  -0.50,   0.44,   0.50,  -0.12,
23888             0.20,  -0.36,  -0.50,   0.12,   0.00,   0.64,  -0.40,   0.50,
23889             0.00,   0.10,   0.00,   0.00,  -0.40,   0.50,   0.00,   0.00,
23890 
23891        /* 3796-3923 */
23892            -0.40,  -0.50,   0.56,   0.00,   0.28,   0.00,   0.10,   0.36,
23893             0.50,   0.00,  -0.10,   0.36,  -0.50,   0.36,   0.50,   0.00,
23894            -0.10,   0.24,  -0.20,  -0.36,  -0.40,   0.16,   0.20,   0.40,
23895            -0.40,   0.00,   0.00,  -0.36,  -0.50,  -0.36,  -0.50,  -0.32,
23896            -0.50,  -0.12,   0.10,   0.20,   0.20,  -0.36,   0.40,  -0.60,
23897             0.60,   0.28,   0.00,   0.52,   0.12,  -0.10,   0.40,   0.40,
23898             0.00,  -0.50,   0.20,  -0.20,  -0.32,   0.40,   0.16,   0.20,
23899            -0.16,   0.20,   0.32,   0.40,   0.56,   0.00,  -0.12,   0.32,
23900            -0.40,  -0.16,  -0.20,   0.00,   0.00,   0.40,   0.40,  -0.40,
23901            -0.40,  -0.40,   0.40,  -0.36,   0.40,   0.12,   0.10,   0.00,
23902             0.10,   0.36,   0.40,   0.00,  -0.10,   0.36,   0.40,  -0.36,
23903             0.40,   0.00,   0.10,   0.32,   0.00,   0.44,   0.12,   0.20,
23904             0.28,  -0.40,   0.00,   0.00,   0.36,   0.40,   0.32,  -0.40,
23905            -0.16,   0.12,   0.10,   0.32,  -0.40,   0.20,   0.30,  -0.24,
23906             0.30,   0.00,   0.10,   0.32,   0.40,   0.00,  -0.10,  -0.32,
23907            -0.40,  -0.32,   0.40,   0.00,   0.10,  -0.52,  -0.52,   0.52,
23908 
23909        /* 3924-4051 */
23910             0.32,  -0.40,   0.00,   0.00,   0.32,   0.40,   0.32,  -0.40,
23911             0.00,   0.00,  -0.32,  -0.40,  -0.32,   0.40,   0.32,   0.40,
23912             0.00,   0.00,   0.32,   0.40,   0.00,   0.00,  -0.32,  -0.40,
23913             0.00,   0.00,   0.32,   0.40,   0.16,   0.20,   0.32,  -0.30,
23914            -0.16,   0.00,  -0.48,  -0.20,   0.20,  -0.28,  -0.30,   0.28,
23915            -0.40,   0.00,   0.00,   0.28,  -0.40,   0.00,   0.00,   0.28,
23916            -0.40,   0.00,   0.00,  -0.28,  -0.40,   0.28,   0.40,  -0.28,
23917            -0.40,  -0.48,  -0.20,   0.20,   0.24,   0.30,   0.44,   0.00,
23918             0.16,   0.24,   0.30,   0.16,  -0.20,   0.24,   0.30,  -0.12,
23919             0.20,   0.20,   0.30,  -0.16,   0.20,   0.00,   0.00,   0.44,
23920            -0.32,   0.30,   0.24,   0.00,  -0.36,   0.36,   0.00,   0.24,
23921             0.12,  -0.20,   0.20,   0.30,  -0.12,   0.00,  -0.28,   0.30,
23922            -0.24,   0.30,   0.12,   0.10,  -0.28,  -0.30,  -0.28,   0.30,
23923             0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,  -0.28,  -0.30,
23924             0.00,   0.00,   0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,
23925            -0.28,   0.30,   0.00,   0.00,  -0.28,  -0.30,   0.00,   0.00,
23926 
23927        /* 4052-4179 */
23928             0.28,   0.30,   0.00,   0.00,  -0.28,   0.30,   0.28,  -0.30,
23929            -0.28,   0.30,   0.40,   0.40,  -0.24,   0.30,   0.00,  -0.10,
23930             0.16,   0.00,   0.36,  -0.20,   0.30,  -0.12,  -0.10,  -0.24,
23931            -0.30,   0.00,   0.00,  -0.24,   0.30,  -0.24,   0.30,   0.00,
23932             0.00,  -0.24,   0.30,  -0.24,   0.30,   0.24,  -0.30,   0.00,
23933             0.00,   0.24,  -0.30,   0.00,   0.00,   0.24,   0.30,   0.24,
23934            -0.30,   0.24,   0.30,  -0.24,   0.30,  -0.24,   0.30,  -0.20,
23935             0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.32,   0.20,   0.00,
23936             0.10,   0.20,  -0.30,   0.20,  -0.20,   0.12,   0.20,  -0.16,
23937             0.20,   0.16,   0.20,   0.20,   0.30,   0.20,   0.30,   0.00,
23938             0.00,  -0.20,   0.30,   0.00,   0.00,   0.20,   0.30,  -0.20,
23939            -0.30,  -0.20,  -0.30,   0.20,  -0.30,   0.00,   0.00,   0.20,
23940             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
23941             0.30,   0.00,   0.00,   0.20,   0.30,   0.00,   0.00,   0.20,
23942            -0.30,   0.00,   0.00,  -0.20,  -0.30,   0.00,   0.00,  -0.20,
23943             0.30,   0.00,   0.00,  -0.20,   0.30,   0.00,   0.00,   0.36,
23944 
23945        /* 4180-4307 */
23946             0.00,   0.00,   0.36,   0.12,   0.10,  -0.24,   0.20,   0.12,
23947            -0.20,  -0.16,  -0.20,  -0.13,   0.10,   0.22,   0.21,   0.20,
23948             0.00,  -0.28,   0.32,   0.00,  -0.12,  -0.20,  -0.20,   0.12,
23949            -0.10,   0.12,   0.10,  -0.20,   0.20,   0.00,   0.00,  -0.32,
23950             0.32,   0.00,   0.00,   0.32,   0.32,   0.00,   0.00,  -0.24,
23951            -0.20,   0.24,   0.20,   0.20,   0.00,  -0.24,   0.00,   0.00,
23952            -0.24,  -0.20,   0.00,   0.00,   0.24,   0.20,  -0.24,  -0.20,
23953             0.00,   0.00,  -0.24,   0.20,   0.16,  -0.20,   0.12,   0.10,
23954             0.20,   0.20,   0.00,  -0.10,  -0.12,   0.10,  -0.16,  -0.20,
23955            -0.12,  -0.10,  -0.16,   0.20,   0.20,   0.20,   0.00,   0.00,
23956            -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,  -0.20,   0.20,
23957             0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,  -0.20,   0.20,
23958             0.20,   0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,  -0.20,
23959             0.20,  -0.20,  -0.20,  -0.20,  -0.20,   0.00,   0.00,   0.20,
23960             0.20,   0.20,   0.20,   0.12,  -0.20,  -0.12,  -0.10,   0.28,
23961            -0.28,   0.16,  -0.20,   0.00,  -0.10,   0.00,   0.10,  -0.16,
23962 
23963        /* 4308-4435 */
23964             0.20,   0.00,  -0.10,  -0.16,  -0.20,   0.00,  -0.10,   0.16,
23965            -0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,   0.20,  -0.16,
23966             0.20,   0.00,   0.00,   0.16,   0.20,   0.16,  -0.20,   0.16,
23967            -0.20,  -0.16,   0.20,   0.16,  -0.20,   0.00,   0.00,   0.16,
23968             0.20,   0.00,   0.00,   0.16,   0.20,   0.00,   0.00,  -0.16,
23969            -0.20,   0.16,  -0.20,  -0.16,  -0.20,   0.00,   0.00,  -0.16,
23970            -0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,   0.00,   0.16,
23971            -0.20,   0.16,   0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,
23972            -0.20,   0.00,   0.00,  -0.16,  -0.20,   0.00,   0.00,   0.16,
23973             0.20,   0.16,   0.20,   0.00,   0.00,   0.16,   0.20,   0.16,
23974            -0.20,   0.16,   0.20,   0.00,   0.00,  -0.16,   0.20,   0.00,
23975             0.10,   0.12,  -0.20,   0.12,  -0.20,   0.00,  -0.10,   0.00,
23976            -0.10,   0.12,   0.20,   0.00,  -0.10,  -0.12,   0.20,  -0.15,
23977             0.20,  -0.24,   0.24,   0.00,   0.00,   0.24,   0.24,   0.12,
23978            -0.20,  -0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
23979            -0.20,   0.12,   0.20,   0.12,   0.20,   0.12,   0.20,   0.12,
23980 
23981        /* 4436-4563 */
23982            -0.20,  -0.12,   0.20,   0.00,   0.00,   0.12,   0.20,   0.12,
23983             0.00,  -0.20,   0.00,   0.00,  -0.12,  -0.20,   0.12,  -0.20,
23984             0.00,   0.00,   0.12,   0.20,  -0.12,   0.20,  -0.12,   0.20,
23985             0.12,  -0.20,   0.00,   0.00,   0.12,   0.20,   0.20,   0.00,
23986             0.12,   0.00,   0.00,  -0.12,   0.20,   0.00,   0.00,  -0.12,
23987            -0.20,   0.00,   0.00,  -0.12,  -0.20,  -0.12,  -0.20,   0.00,
23988             0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,   0.20,  -0.12,
23989            -0.20,   0.00,   0.00,   0.12,  -0.20,   0.12,  -0.20,   0.12,
23990             0.20,   0.12,   0.00,   0.20,  -0.12,  -0.20,   0.00,   0.00,
23991             0.12,   0.20,  -0.16,   0.00,   0.16,  -0.20,   0.20,   0.00,
23992             0.00,  -0.20,   0.00,   0.00,  -0.20,   0.20,   0.00,   0.00,
23993             0.20,   0.20,  -0.20,   0.00,   0.00,  -0.20,   0.12,   0.00,
23994            -0.16,   0.20,   0.00,   0.00,   0.20,   0.12,  -0.10,   0.00,
23995             0.10,   0.16,  -0.16,  -0.16,  -0.16,  -0.16,  -0.16,   0.00,
23996             0.00,  -0.16,   0.00,   0.00,  -0.16,  -0.16,  -0.16,   0.00,
23997             0.00,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,   0.16,
23998 
23999        /* 4564-4691 */
24000             0.00,   0.00,   0.16,   0.16,   0.00,   0.00,  -0.16,   0.00,
24001             0.00,  -0.16,  -0.16,   0.00,   0.00,   0.16,   0.00,   0.00,
24002            -0.16,  -0.16,   0.00,   0.00,  -0.16,  -0.16,   0.12,   0.10,
24003             0.12,  -0.10,   0.12,   0.10,   0.00,   0.00,   0.12,   0.10,
24004            -0.12,   0.10,   0.00,   0.00,   0.12,   0.10,   0.12,  -0.10,
24005             0.00,   0.00,  -0.12,  -0.10,   0.00,   0.00,   0.12,   0.10,
24006             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,  -0.12,   0.00,
24007             0.00,   0.12,   0.12,   0.12,   0.12,   0.12,   0.00,   0.00,
24008             0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,   0.12,
24009             0.00,   0.00,   0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,
24010            -0.12,   0.00,   0.00,   0.12,  -0.12,   0.12,   0.12,  -0.12,
24011            -0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24012             0.12,   0.00,   0.00,   0.12,   0.00,   0.00,   0.12,   0.00,
24013             0.00,   0.12,  -0.12,   0.00,   0.00,  -0.12,   0.12,  -0.12,
24014            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.12,  -0.12,
24015             0.00,   0.00,  -0.12,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24016 
24017        /* 4692-NA */
24018            -0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,  -0.12,
24019            -0.12,  -0.12,  -0.12,   0.12,   0.00,   0.00,   0.12,  -0.12,
24020             0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,   0.12,  -0.12,
24021            -0.12,  -0.12,  -0.12,   0.12,   0.12,  -0.12,  -0.12,   0.00,
24022             0.00,  -0.12,   0.00,   0.00,  -0.12,   0.12,   0.00,   0.00,
24023             0.12,   0.00,   0.00,  -0.12,  -0.12,   0.00,   0.00,  -0.12,
24024            -0.12,   0.12,   0.00,   0.00,   0.12,   0.12,   0.00,   0.00,
24025             0.12,   0.00,   0.00,   0.12,   0.12,   0.08,   0.00,   0.04
24026        };
24027 
24028     /* Number of amplitude coefficients */
24029         final int NA = a.length;
24030 
24031     /* Amplitude usage: X or Y, sin or cos, power of T. */
24032         final int jaxy[] = {0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1};
24033         final int jasc[] = {0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0};
24034         final int japt[] = {0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4};
24035 
24036     /* Miscellaneous */
24037        double t, w, pt[] = new double[MAXPT+1], fa[] = new double[14], xypr[] = new double[2], xypl[] = new double[2], xyls[] = new double[2], arg,
24038               sc[] = new double[2];
24039        int jpt, i, j, jxy, ialast, ifreq, m, ia, jsc;
24040 
24041     /*--------------------------------------------------------------------*/
24042 
24043     /* Interval between fundamental date J2000.0 and given date (JC). */
24044        t = ((date1 - DJ00) + date2) / DJC;
24045 
24046     /* Powers of T. */
24047        w = 1.0;
24048        for (jpt = 0; jpt <= MAXPT; jpt++) {
24049           pt[jpt] = w;
24050           w *= t;
24051        }
24052 
24053     /* Initialize totals in X and Y:  polynomial, luni-solar, planetary. */
24054        for (jxy = 0; jxy < 2; jxy++) {
24055           xypr[jxy] = 0.0;
24056           xyls[jxy] = 0.0;
24057           xypl[jxy] = 0.0;
24058        }
24059 
24060     /* --------------------------------- */
24061     /* Fundamental arguments (IERS 2003) */
24062     /* --------------------------------- */
24063 
24064     /* Mean anomaly of the Moon. */
24065        fa[0] = jauFal03(t);
24066 
24067     /* Mean anomaly of the Sun. */
24068        fa[1] = jauFalp03(t);
24069 
24070     /* Mean argument of the latitude of the Moon. */
24071        fa[2] = jauFaf03(t);
24072 
24073     /* Mean elongation of the Moon from the Sun. */
24074        fa[3] = jauFad03(t);
24075 
24076     /* Mean longitude of the ascending node of the Moon. */
24077        fa[4] = jauFaom03(t);
24078 
24079     /* Planetary longitudes, Mercury through Neptune. */
24080        fa[5] = jauFame03(t);
24081        fa[6] = jauFave03(t);
24082        fa[7] = jauFae03(t);
24083        fa[8] = jauFama03(t);
24084        fa[9] = jauFaju03(t);
24085        fa[10] = jauFasa03(t);
24086        fa[11] = jauFaur03(t);
24087        fa[12] = jauFane03(t);
24088 
24089     /* General accumulated precession in longitude. */
24090        fa[13] = jauFapa03(t);
24091 
24092     /* -------------------------------------- */
24093     /* Polynomial part of precession-nutation */
24094     /* -------------------------------------- */
24095 
24096        for (jxy = 0; jxy < 2; jxy++) {
24097           for (j = MAXPT; j >= 0; j--) {
24098              xypr[jxy] += xyp[jxy][j] * pt[j];
24099           }
24100        }
24101 
24102     /* ---------------------------------- */
24103     /* Nutation periodic terms, planetary */
24104     /* ---------------------------------- */
24105 
24106     /* Work backwards through the coefficients per frequency list. */
24107        ialast = NA;
24108        for (ifreq = NFPL-1; ifreq >= 0; ifreq--) {
24109 
24110        /* Obtain the argument functions. */
24111           arg = 0.0;
24112           for (i = 0; i < 14; i++) {
24113              m = mfapl[ifreq][i];
24114              if (m != 0) arg += (double)m * fa[i];
24115           }
24116           sc[0] = sin(arg);
24117           sc[1] = cos(arg);
24118 
24119        /* Work backwards through the amplitudes at this frequency. */
24120           ia = nc[ifreq+NFLS];
24121           for (i = ialast; i >= ia; i--) {
24122 
24123           /* Coefficient number (0 = 1st). */
24124              j = i-ia;
24125 
24126           /* X or Y. */
24127              jxy = jaxy[j];
24128 
24129           /* Sin or cos. */
24130              jsc = jasc[j];
24131 
24132           /* Power of T. */
24133              jpt = japt[j];
24134 
24135           /* Accumulate the component. */
24136              xypl[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24137           }
24138           ialast = ia-1;
24139        }
24140 
24141     /* ----------------------------------- */
24142     /* Nutation periodic terms, luni-solar */
24143     /* ----------------------------------- */
24144 
24145     /* Continue working backwards through the number of coefficients list. */
24146        for (ifreq = NFLS-1; ifreq >= 0; ifreq--) {
24147 
24148        /* Obtain the argument functions. */
24149           arg = 0.0;
24150           for (i = 0; i < 5; i++) {
24151              m = mfals[ifreq][i];
24152              if (m != 0) arg += (double)m * fa[i];
24153           }
24154           sc[0] = sin(arg);
24155           sc[1] = cos(arg);
24156 
24157        /* Work backwards through the amplitudes at this frequency. */
24158           ia = nc[ifreq];
24159           for (i = ialast; i >= ia; i--) {
24160 
24161           /* Coefficient number (0 = 1st). */
24162              j = i-ia;
24163 
24164           /* X or Y. */
24165              jxy = jaxy[j];
24166 
24167           /* Sin or cos. */
24168              jsc = jasc[j];
24169 
24170           /* Power of T. */
24171              jpt = japt[j];
24172 
24173           /* Accumulate the component. */
24174              xyls[jxy] += a[i-1] * sc[jsc] * pt[jpt];
24175           }
24176           ialast = ia-1;
24177        }
24178 
24179     /* ------------------------------------ */
24180     /* Results:  CIP unit vector components */
24181     /* ------------------------------------ */
24182 
24183        double x = DAS2R * (xypr[0] + (xyls[0] + xypl[0]) / 1e6);
24184        double y = DAS2R * (xypr[1] + (xyls[1] + xypl[1]) / 1e6);
24185 
24186        return new CelestialIntermediatePole(x, y);
24187 
24188         }
24189     
24190 
24191     /**
24192     *  For a given TT date, compute the X,Y coordinates of the Celestial
24193     *  Intermediate Pole and the CIO locator s, using the IAU 2000A
24194     *  precession-nutation model.
24195     *
24196     *<p>This function is derived from the International Astronomical Union's
24197     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24198     *
24199     *<p>Status:  support function.
24200     *
24201     *<!-- Given: -->
24202     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24203     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24204     *
24205     *<!-- Returned: -->
24206     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24207     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24208     *             s double     <u>returned</u> the CIO locator s (Note 2)
24209     *
24210     * <p>Notes:
24211     * <ol>
24212     *
24213     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24214     *     convenient way between the two arguments.  For example,
24215     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24216     *     among others:
24217     *<pre>
24218     *            date1          date2
24219     *
24220     *         2450123.7           0.0       (JD method)
24221     *         2451545.0       -1421.3       (J2000 method)
24222     *         2400000.5       50123.2       (MJD method)
24223     *         2450123.5           0.2       (date &amp; time method)
24224     *</pre>
24225     *     The JD method is the most natural and convenient to use in
24226     *     cases where the loss of several decimal digits of resolution
24227     *     is acceptable.  The J2000 method is best matched to the way
24228     *     the argument is handled internally and will deliver the
24229     *     optimum resolution.  The MJD method and the date &amp; time methods
24230     *     are both good compromises between resolution and convenience.
24231     *
24232     * <li> The Celestial Intermediate Pole coordinates are the x,y
24233     *     components of the unit vector in the Geocentric Celestial
24234     *     Reference System.
24235     *
24236     * <li> The CIO locator s (in radians) positions the Celestial
24237     *     Intermediate Origin on the equator of the CIP.
24238     *
24239     * <li> A faster, but slightly less accurate result (about 1 mas for
24240     *     X,Y), can be obtained by using instead the jauXys00b function.
24241     *</ol>
24242     *<p>Called:<ul>
24243     *     <li>{@link #jauPnm00a} classical NPB matrix, IAU 2000A
24244     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24245     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24246     * </ul>
24247     *<p>Reference:
24248     *
24249     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24250     *     IERS Technical Note No. 32, BKG (2004)
24251     *
24252     *@version 2008 May 12
24253     *
24254     *  @since Release 20101201
24255     *
24256     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24257     */
24258     public static ICRFrame jauXys00a(double date1, double date2)
24259     {
24260 
24261     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24262        double rbpn[][] = jauPnm00a(date1, date2);
24263 
24264     /* Extract X,Y. */
24265        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24266 
24267     /* Obtain s. */
24268        double s = jauS00(date1, date2, cip.x, cip.y);
24269 
24270        return new ICRFrame(cip, s);
24271 
24272         }
24273     
24274 
24275     /**
24276      *    The Celestial Intermediate Pole coordinates are the x,y
24277     *     components of the unit vector in the Geocentric Celestial
24278     *     Reference System.
24279     *
24280     *  The CIO locator s (in radians) positions the Celestial
24281     *     Intermediate Origin on the equator of the CIP.
24282  
24283      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
24284      * 
24285      * @since AIDA Stage 1
24286      */
24287     public static class ICRFrame {
24288         public CelestialIntermediatePole cip;
24289         public double s;
24290         public ICRFrame(CelestialIntermediatePole cip, double s) {
24291             this.cip = cip;
24292             this.s = s;
24293         }
24294     }
24295     /**
24296     *  For a given TT date, compute the X,Y coordinates of the Celestial
24297     *  Intermediate Pole and the CIO locator s, using the IAU 2000B
24298     *  precession-nutation model.
24299     *
24300     *<p>This function is derived from the International Astronomical Union's
24301     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24302     *
24303     *<p>Status:  support function.
24304     *
24305     *<!-- Given: -->
24306     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24307     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24308     *
24309     *<!-- Returned: -->
24310     *     @return x double     <u>returned</u> Celestial Intermediate Pole (Note 2)
24311     *             y double     <u>returned</u> Celestial Intermediate Pole (Note 2) 
24312     *             s             double     <u>returned</u> the CIO locator s (Note 2)
24313     *
24314     * <p>Notes:
24315     * <ol>
24316     *
24317     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24318     *     convenient way between the two arguments.  For example,
24319     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24320     *     among others:
24321     *<pre>
24322     *            date1          date2
24323     *
24324     *         2450123.7           0.0       (JD method)
24325     *         2451545.0       -1421.3       (J2000 method)
24326     *         2400000.5       50123.2       (MJD method)
24327     *         2450123.5           0.2       (date &amp; time method)
24328     *</pre>
24329     *     The JD method is the most natural and convenient to use in
24330     *     cases where the loss of several decimal digits of resolution
24331     *     is acceptable.  The J2000 method is best matched to the way
24332     *     the argument is handled internally and will deliver the
24333     *     optimum resolution.  The MJD method and the date &amp; time methods
24334     *     are both good compromises between resolution and convenience.
24335     *
24336     * <li> The Celestial Intermediate Pole coordinates are the x,y
24337     *     components of the unit vector in the Geocentric Celestial
24338     *     Reference System.
24339     *
24340     * <li> The CIO locator s (in radians) positions the Celestial
24341     *     Intermediate Origin on the equator of the CIP.
24342     *
24343     * <li> The present function is faster, but slightly less accurate (about
24344     *     1 mas in X,Y), than the jauXys00a function.
24345     *</ol>
24346     *<p>Called:<ul>
24347     *     <li>{@link #jauPnm00b} classical NPB matrix, IAU 2000B
24348     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24349     *     <li>{@link #jauS00} the CIO locator s, given X,Y, IAU 2000A
24350     * </ul>
24351     *<p>Reference:
24352     *
24353     *     <p>McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
24354     *     IERS Technical Note No. 32, BKG (2004)
24355     *
24356     *@version 2008 May 12
24357     *
24358     *  @since Release 20101201
24359     *
24360     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24361     */
24362     public static ICRFrame jauXys00b(double date1, double date2)
24363     {
24364        double rbpn[][] = new double[3][3];
24365 
24366 
24367     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24368        rbpn = jauPnm00b(date1, date2);
24369 
24370     /* Extract X,Y. */
24371        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24372 
24373     /* Obtain s. */
24374        double s = jauS00(date1, date2, cip.x, cip.y);
24375 
24376        return new ICRFrame(cip, s);
24377 
24378         }
24379     
24380 
24381     /**
24382     *  For a given TT date, compute the X,Y coordinates of the Celestial
24383     *  Intermediate Pole and the CIO locator s, using the IAU 2006
24384     *  precession and IAU 2000A nutation models.
24385     *
24386     *<p>This function is derived from the International Astronomical Union's
24387     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24388     *
24389     *<p>Status:  support function.
24390     *
24391     *<!-- Given: -->
24392     *     @param date1 double TT as a 2-part Julian Date (Note 1)
24393     *     @param date2 double TT as a 2-part Julian Date (Note 1)
24394     *
24395     *<!-- Returned: -->
24396     *     @return x double    <u>returned</u> Celestial Intermediate Pole (Note 2)
24397     *             y double    <u>returned</u> Celestial Intermediate Pole (Note 2) 
24398     *             s             double    <u>returned</u> the CIO locator s (Note 2)
24399     *
24400     * <p>Notes:
24401     * <ol>
24402     *
24403     * <li> The TT date date1+date2 is a Julian Date, apportioned in any
24404     *     convenient way between the two arguments.  For example,
24405     *     JD(TT)=2450123.7 could be expressed in any of these ways,
24406     *     among others:
24407     *<pre>
24408     *            date1          date2
24409     *
24410     *         2450123.7           0.0       (JD method)
24411     *         2451545.0       -1421.3       (J2000 method)
24412     *         2400000.5       50123.2       (MJD method)
24413     *         2450123.5           0.2       (date &amp; time method)
24414     *</pre>
24415     *     The JD method is the most natural and convenient to use in
24416     *     cases where the loss of several decimal digits of resolution
24417     *     is acceptable.  The J2000 method is best matched to the way
24418     *     the argument is handled internally and will deliver the
24419     *     optimum resolution.  The MJD method and the date &amp; time methods
24420     *     are both good compromises between resolution and convenience.
24421     *
24422     * <li> The Celestial Intermediate Pole coordinates are the x,y components
24423     *     of the unit vector in the Geocentric Celestial Reference System.
24424     *
24425     * <li> The CIO locator s (in radians) positions the Celestial
24426     *     Intermediate Origin on the equator of the CIP.
24427     *
24428     * <li> Series-based solutions for generating X and Y are also available:
24429     *     see Capitaine &amp; Wallace (2006) and jauXy06.
24430     *</ol>
24431     *<p>Called:<ul>
24432     *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
24433     *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
24434     *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
24435     * </ul>
24436     *<p>References:
24437     *
24438     *    <p>Capitaine, N. &amp; Wallace, P.T., 2006, Astron.Astrophys. 450, 855
24439     *
24440     *    <p>Wallace, P.T. &amp; Capitaine, N., 2006, Astron.Astrophys. 459, 981
24441     *
24442     *@version 2008 May 11
24443     *
24444     *  @since Release 20101201
24445     *
24446     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24447     */
24448     public static ICRFrame jauXys06a(double date1, double date2)
24449     {
24450        double rbpn[][] = new double[3][3];
24451 
24452 
24453     /* Form the bias-precession-nutation matrix, IAU 2000A. */
24454        rbpn = jauPnm06a(date1, date2);
24455 
24456     /* Extract X,Y. */
24457        CelestialIntermediatePole cip = jauBpn2xy(rbpn);
24458 
24459     /* Obtain s. */
24460        double s = jauS06(date1, date2, cip.x, cip.y);
24461 
24462        return new ICRFrame(cip, s);
24463 
24464         }
24465     
24466 
24467     /**
24468     *  Zero a p-vector.
24469     *
24470     *<p>This function is derived from the International Astronomical Union's
24471     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24472     *
24473     *<p>Status:  vector/matrix support function.
24474     *
24475     *<!-- Returned: -->
24476     *     @param p         double[3]        <u>returned</u> p-vector
24477     *
24478     *@version 2008 May 11
24479     *
24480     *  @since Release 20101201
24481     *
24482     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24483     */
24484     public static void jauZp(double p[] )
24485     {
24486        p[0] = 0.0;
24487        p[1] = 0.0;
24488        p[2] = 0.0;
24489 
24490        return;
24491 
24492         }
24493     
24494 
24495     /**
24496     *  Zero a pv-vector.
24497     *
24498     *<p>This function is derived from the International Astronomical Union's
24499     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24500     *
24501     *<p>Status:  vector/matrix support function.
24502     *
24503     *<!-- Returned: -->
24504     *     @param pv        double[2][3]        <u>returned</u> pv-vector
24505     *
24506     *<p>Called:<ul>
24507     *     <li>{@link #jauZp} zero p-vector
24508     * </ul>
24509     *@version 2008 May 11
24510     *
24511     *  @since Release 20101201
24512     *
24513     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24514     */
24515     public static void jauZpv(double pv[][])
24516     {
24517        jauZp(pv[0]);
24518        jauZp(pv[1]);
24519 
24520        return;
24521 
24522         }
24523     
24524 
24525     /**
24526     *  Initialize an r-matrix to the null matrix.
24527     *
24528     *<p>This function is derived from the International Astronomical Union's
24529     *  SOFA (Standards Of Fundamental Astronomy) software collection.
24530     *
24531     *<p>Status:  vector/matrix support function.
24532     *
24533     *<!-- Returned: -->
24534     *     @param r         double[3][3]      <u>returned</u> r-matrix
24535     *
24536     *@version 2008 May 11
24537     *
24538     *  @since Release 20101201 
24539     *
24540     *  <!-- Copyright (C) 2009 IAU SOFA Review Board.  See notes at end -->
24541     */
24542     public static void jauZr(double r[][])
24543     {
24544        int i, j;
24545 
24546 
24547        for (i = 0; i < 3; i++) {
24548           for (j = 0; j < 3; j++) {
24549              r[i][j] = 0.0;
24550           }
24551        }
24552 
24553        return;
24554 
24555         }
24556     
24557 
24558     /**
24559      * returns the first argument modulo the second.
24560      * Utility function to retain C use of fmod.
24561      * @param d
24562      * @param d2
24563      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 27 Jan 2010
24564      * @return
24565      */
24566     private static double fmod(double d, double d2) {
24567         return d % d2;
24568     }
24569  //IMPL new 20131202 routines after here
24570 
24571     /**
24572      *  Star-independent astrometry parameters.
24573      * 
24574      *  (Vectors eb, eh, em and v are all with respect to BCRS axes.)
24575      *  
24576      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24577      *  @since 20131202
24578      */
24579     public static class  Astrom {
24580         
24581 /** PM time interval (SSB, Julian years) */
24582        public double pmt;       
24583 /** SSB to observer (vector, au) [3]*/
24584        public double eb[] = new double[3];      
24585 /** Sun to observer (unit vector)[3] */
24586        public double eh[] = new double[3];      
24587 /** distance from Sun to observer (au) */
24588        public double em;         
24589 /** barycentric observer velocity (vector, c)[3] */
24590        public double v[] = new double[3];       
24591 /** sqrt(1-|v|^2): reciprocal of Lorenz factor */
24592        public double bm1;        
24593 /** bias-precession-nutation matrix [3][3] */
24594        public double bpn[][] = new double[3][3];  
24595 /** longitude + s' + dERA(DUT) (radians) */
24596        public double along;      
24597 /** geodetic latitude (radians) */
24598        public double phi;        
24599 /** polar motion xp wrt local meridian (radians) */
24600        public double xpl;        
24601 /** polar motion yp wrt local meridian (radians) */
24602        public double ypl;        
24603 /** sine of geodetic latitude */
24604        public double sphi;       
24605 /** cosine of geodetic latitude */
24606        public double cphi;       
24607 /** magnitude of diurnal aberration vector */
24608        public double diurab;     
24609 /** "local" Earth rotation angle (radians) */
24610        public double eral;       
24611 /** refraction constant A (radians) */
24612        public double refa;       
24613 /** refraction constant B (radians) */
24614        public double refb;       
24615        
24616        /**
24617         * 
24618         */
24619        public Astrom(){}
24620     } ;
24621 
24622     /**
24623      *  Body parameters for light deflection.
24624      *  @author Paul Harrison (paul.harrison@manchester.ac.uk) 26 Mar 2014
24625      *  @since 20131202
24626      */
24627     public static class Ldbody {
24628         /** mass of the body (solar masses) */
24629        public double bm;
24630        /** deflection limiter (radians^2/2) */
24631        public double dl; 
24632        /** barycentric PV of the body (au, au/day)[2][3] */
24633        public double pv[][] = new double [2][3];   
24634     } ;
24635 
24636 
24637     /**
24638      *  Apply aberration to transform natural direction into proper
24639      *  direction.
24640      *
24641      *<p>This function is derived from the International Astronomical Union's
24642      *  SOFA (Standards of Fundamental Astronomy) software collection.
24643      *
24644      *<p>Status:  support function.
24645      *
24646      *<!-- Given: -->
24647      *    @param pnat     double[3]    natural direction to the source (unit vector)
24648      *    @param v        double[3]    observer barycentric velocity in units of c
24649      *    @param s        double       distance between the Sun and the observer (au)
24650      *    @param bm1      double       sqrt(1-|v|^2): reciprocal of Lorenz factor
24651      *
24652      *<!-- Returned:-->
24653      *    @return ppr      double[3]     <b>Returned</b> proper direction to source (unit vector)
24654      *
24655      *<p>Notes:
24656      * <ol>
24657      *
24658      *  <li> The algorithm is based on Expr. (7.40) in the Explanatory
24659      *     Supplement (Urban &amp; Seidelmann 2013), but with the following
24660      *     changes:
24661      *
24662      *     <p>o  Rigorous rather than approximate normalization is applied.
24663      *
24664      *     <p>o  The gravitational potential term from Expr. (7) in
24665      *        Klioner (2003) is added, taking into account only the Sun's
24666      *        contribution.  This has a maximum effect of about
24667      *        0.4 microarcsecond.
24668      *
24669      *  <li> In almost all cases, the maximum accuracy will be limited by the
24670      *     supplied velocity.  For example, if the SOFA iauEpv00 function is
24671      *     used, errors of up to 5 microarcseconds could occur.
24672      *
24673      * </ol>
24674      *<p>References:
24675      * <ul>
24676      *
24677      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
24678      *     the Astronomical Almanac, 3rd ed., University Science Books
24679      *     (2013).
24680      *
24681      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
24682      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
24683      *
24684      * </ul>
24685      *  Called:
24686      * <ul>
24687      *     <li>{@link #jauPdp} scalar product of two p-vectors
24688      *
24689      * </ul>
24690      *@version  2013 October 9
24691      *
24692      *@since JSOFA release 20131202
24693      *
24694      *
24695      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24696      */
24697     public static  double[] jauAb(double pnat[], double v[], double s, double bm1
24698            )
24699     {
24700         int i;
24701         double pdv, w1, w2, r2, w, p[] = new double[3], r;
24702         double ppr[] = new double[3];
24703 
24704         pdv = jauPdp(pnat, v);
24705         w1 = 1.0 + pdv/(1.0 + bm1);
24706         w2 = SRS/s;
24707         r2 = 0.0;
24708         for (i = 0; i < 3; i++) {
24709             w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
24710             p[i] = w;
24711             r2 = r2 + w*w;
24712         }
24713         r = sqrt(r2);
24714         for (i = 0; i < 3; i++) {
24715             ppr[i] = p[i]/r;
24716         }
24717         return ppr;
24718         /* Finished. */
24719 
24720 
24721     }
24722 
24723     /**
24724      *  For a geocentric observer, prepare star-independent astrometry
24725      *  parameters for transformations between ICRS and GCRS coordinates.
24726      *  The Earth ephemeris is supplied by the caller.
24727      *
24728      *  The parameters produced by this function are required in the
24729      *  parallax, light deflection and aberration parts of the astrometric
24730      *  transformation chain.
24731      *
24732      *<p>This function is derived from the International Astronomical Union's
24733      *  SOFA (Standards of Fundamental Astronomy) software collection.
24734      *
24735      *<p>Status:  support function.
24736      *
24737      *<!-- Given: -->
24738      *     @param date1   double        TDB as a 2-part...
24739      *     @param date2   double        ...Julian Date (Note 1)
24740      *     @param ebpv    double[2][3]  Earth barycentric pos/vel (au, au/day)
24741      *     @param ehp     double[3]     Earth heliocentric position (au)
24742      *
24743      *<!-- Returned:-->
24744      *     @param astrom  jauASTROM     <b>Returned</b> star-independent astrometry parameters:
24745      *
24746      *<p>Notes:
24747      * <ol>
24748      *
24749      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24750      *     convenient way between the two arguments.  For example,
24751      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24752      *     others:
24753      *     <pre>
24754      *           date1          date2
24755      *
24756      *         2450123.7           0.0       (JD method)
24757      *         2451545.0       -1421.3       (J2000 method)
24758      *         2400000.5       50123.2       (MJD method)
24759      *         2450123.5           0.2       (date &amp; time method)
24760      *     </pre>
24761      *     <p>The JD method is the most natural and convenient to use in cases
24762      *     where the loss of several decimal digits of resolution is
24763      *     acceptable.  The J2000 method is best matched to the way the
24764      *     argument is handled internally and will deliver the optimum
24765      *     resolution.  The MJD method and the date &amp; time methods are both
24766      *     good compromises between resolution and convenience.  For most
24767      *     applications of this function the choice will not be at all
24768      *     critical.
24769      *
24770      *     <p>TT can be used instead of TDB without any significant impact on
24771      *     accuracy.
24772      *
24773      *  <li> All the vectors are with respect to BCRS axes.
24774      *
24775      *  <li> This is one of several functions that inserts into the astrom
24776      *     structure star-independent parameters needed for the chain of
24777      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
24778      *
24779      *     <p>The various functions support different classes of observer and
24780      *     portions of the transformation chain:
24781      *     <pre>{@code
24782      *          functions         observer        transformation
24783      *
24784      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
24785      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
24786      *       iauApco iauApco13    terrestrial     ICRS <-> observed
24787      *       iauApcs iauApcs13    space           ICRS <-> GCRS
24788      *       iauAper iauAper13    terrestrial     update Earth rotation
24789      *       iauApio iauApio13    terrestrial     CIRS <-> observed
24790      *     }</pre>
24791      *     
24792      *     <p>Those with names ending in "13" use contemporary SOFA models to
24793      *     compute the various ephemerides.  The others accept ephemerides
24794      *     supplied by the caller.
24795      *
24796      *     <p>The transformation from ICRS to GCRS covers space motion,
24797      *     parallax, light deflection, and aberration.  From GCRS to CIRS
24798      *     comprises frame bias and precession-nutation.  From CIRS to
24799      *     observed takes account of Earth rotation, polar motion, diurnal
24800      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
24801      *     transformation), and atmospheric refraction.
24802      *
24803      *  <li> The context structure astrom produced by this function is used by
24804      *     iauAtciq* and iauAticq*.
24805      *
24806      * </ol>
24807      *  Called:
24808      * <ul>
24809      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
24810      *
24811      * </ul>
24812      *@version  2013 October 9
24813      *
24814      *@since JSOFA release 20131202
24815      *
24816      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24817      */
24818     public static void jauApcg(double date1, double date2,
24819             double ebpv[][], double ehp[],
24820             Astrom astrom)
24821     {
24822         /* Geocentric observer */
24823         double pv[][] = { { 0.0, 0.0, 0.0 },
24824             { 0.0, 0.0, 0.0 } };
24825 
24826 
24827             /* Compute the star-independent astrometry parameters. */
24828             jauApcs(date1, date2, pv, ebpv, ehp, astrom);
24829 
24830             /* Finished. */
24831 
24832 
24833     }
24834 
24835     /**
24836      *  For a geocentric observer, prepare star-independent astrometry
24837      *  parameters for transformations between ICRS and GCRS coordinates.
24838      *  The caller supplies the date, and SOFA models are used to predict
24839      *  the Earth ephemeris.
24840      *
24841      *  The parameters produced by this function are required in the
24842      *  parallax, light deflection and aberration parts of the astrometric
24843      *  transformation chain.
24844      *
24845      *<p>This function is derived from the International Astronomical Union's
24846      *  SOFA (Standards of Fundamental Astronomy) software collection.
24847      *
24848      *<p>Status:  support function.
24849      *
24850      *<!-- Given: -->
24851      *     @param date1   double      TDB as a 2-part...
24852      *     @param date2   double      ...Julian Date (Note 1)
24853      *
24854      *<!-- Returned:-->
24855      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
24856      *
24857      *<p>Notes:
24858      * <ol>
24859      *
24860      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24861      *     convenient way between the two arguments.  For example,
24862      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24863      *     others:
24864      *     <pre>
24865      *            date1          date2
24866      *
24867      *         2450123.7           0.0       (JD method)
24868      *         2451545.0       -1421.3       (J2000 method)
24869      *         2400000.5       50123.2       (MJD method)
24870      *         2450123.5           0.2       (date &amp; time method)
24871      *     </pre>
24872      *     <p>The JD method is the most natural and convenient to use in cases
24873      *     where the loss of several decimal digits of resolution is
24874      *     acceptable.  The J2000 method is best matched to the way the
24875      *     argument is handled internally and will deliver the optimum
24876      *     resolution.  The MJD method and the date &amp; time methods are both
24877      *     good compromises between resolution and convenience.  For most
24878      *     applications of this function the choice will not be at all
24879      *     critical.
24880      *
24881      *     <p>TT can be used instead of TDB without any significant impact on
24882      *     accuracy.
24883      *
24884      *  <li> All the vectors are with respect to BCRS axes.
24885      *
24886      *  <li> In cases where the caller wishes to supply his own Earth
24887      *     ephemeris, the function iauApcg can be used instead of the present
24888      *     function.
24889      *
24890      *  <li> This is one of several functions that inserts into the astrom
24891      *     structure star-independent parameters needed for the chain of
24892      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed}.
24893      *
24894      *     <p>The various functions support different classes of observer and
24895      *     portions of the transformation chain:
24896      *     <pre>
24897      *     {@code
24898      *          functions         observer        transformation
24899      *
24900      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
24901      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
24902      *       iauApco iauApco13    terrestrial     ICRS <-> observed
24903      *       iauApcs iauApcs13    space           ICRS <-> GCRS
24904      *       iauAper iauAper13    terrestrial     update Earth rotation
24905      *       iauApio iauApio13    terrestrial     CIRS <-> observed
24906      *     }
24907      *     </pre>
24908      *     <p>Those with names ending in "13" use contemporary SOFA models to
24909      *     compute the various ephemerides.  The others accept ephemerides
24910      *     supplied by the caller.
24911      *
24912      *     <p>The transformation from ICRS to GCRS covers space motion,
24913      *     parallax, light deflection, and aberration.  From GCRS to CIRS
24914      *     comprises frame bias and precession-nutation.  From CIRS to
24915      *     observed takes account of Earth rotation, polar motion, diurnal
24916      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
24917      *     transformation), and atmospheric refraction.
24918      *
24919      *  <li> The context structure astrom produced by this function is used by
24920      *     iauAtciq* and iauAticq*.
24921      *
24922      * </ol>
24923      *  Called:
24924      * <ul>
24925      *     <li>{@link #jauEpv00} Earth position and velocity
24926      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
24927      *
24928      * </ul>
24929      *@version  2013 October 9
24930      *
24931      *@since JSOFA release 20131202
24932      *
24933      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
24934      */
24935     public static void jauApcg13(double date1, double date2, Astrom astrom)
24936     {
24937         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
24938 
24939 
24940         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
24941         jauEpv00(date1, date2, ehpv, ebpv);
24942 
24943         /* Compute the star-independent astrometry parameters. */
24944         jauApcg(date1, date2, ebpv, ehpv[0], astrom);
24945 
24946         /* Finished. */
24947 
24948 
24949     }
24950 
24951     /**
24952      *  For a terrestrial observer, prepare star-independent astrometry
24953      *  parameters for transformations between ICRS and geocentric CIRS
24954      *  coordinates.  The Earth ephemeris and CIP/CIO are supplied by the
24955      *  caller.
24956      *
24957      *  The parameters produced by this function are required in the
24958      *  parallax, light deflection, aberration, and bias-precession-nutation
24959      *  parts of the astrometric transformation chain.
24960      *
24961      *<p>This function is derived from the International Astronomical Union's
24962      *  SOFA (Standards of Fundamental Astronomy) software collection.
24963      *
24964      *<p>Status:  support function.
24965      *
24966      *<!-- Given: -->
24967      *     @param date1   double        TDB as a 2-part...
24968      *     @param date2   double        ...Julian Date (Note 1)
24969      *     @param ebpv    double[2][3]  Earth barycentric position/velocity (au, au/day)
24970      *     @param ehp     double[3]     Earth heliocentric position (au)
24971      *     @param x double        CIP X,Y (components of unit vector)
24972      *     @param y double        CIP X,Y (components of unit vector) 
24973      *     @param s       double        the CIO locator s (radians)
24974      *
24975      *<!-- Returned:-->
24976      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
24977      *
24978      *<p>Notes:
24979      * <ol>
24980      *
24981      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
24982      *     convenient way between the two arguments.  For example,
24983      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
24984      *     others:
24985      *     <pre>
24986      *            date1          date2
24987      *
24988      *         2450123.7           0.0       (JD method)
24989      *         2451545.0       -1421.3       (J2000 method)
24990      *         2400000.5       50123.2       (MJD method)
24991      *         2450123.5           0.2       (date &amp; time method)
24992      *     </pre>
24993      *     <p>The JD method is the most natural and convenient to use in cases
24994      *     where the loss of several decimal digits of resolution is
24995      *     acceptable.  The J2000 method is best matched to the way the
24996      *     argument is handled internally and will deliver the optimum
24997      *     resolution.  The MJD method and the date &amp; time methods are both
24998      *     good compromises between resolution and convenience.  For most
24999      *     applications of this function the choice will not be at all
25000      *     critical.
25001      *
25002      *     <p>TT can be used instead of TDB without any significant impact on
25003      *     accuracy.
25004      *
25005      *  <li> All the vectors are with respect to BCRS axes.
25006      *
25007      *  <li> In cases where the caller does not wish to provide the Earth
25008      *     ephemeris and CIP/CIO, the function iauApci13 can be used instead
25009      *     of the present function.  This computes the required quantities
25010      *     using other SOFA functions.
25011      *
25012      *  <li> This is one of several functions that inserts into the astrom
25013      *     structure star-independent parameters needed for the chain of
25014      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25015      *
25016      *     <p>The various functions support different classes of observer and
25017      *     portions of the transformation chain:
25018      *     <pre>{@code
25019      *          functions         observer        transformation
25020      *
25021      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25022      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25023      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25024      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25025      *       iauAper iauAper13    terrestrial     update Earth rotation
25026      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25027      *     }</pre>
25028      *     <p>Those with names ending in "13" use contemporary SOFA models to
25029      *     compute the various ephemerides.  The others accept ephemerides
25030      *     supplied by the caller.
25031      *
25032      *     <p>The transformation from ICRS to GCRS covers space motion,
25033      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25034      *     comprises frame bias and precession-nutation.  From CIRS to
25035      *     observed takes account of Earth rotation, polar motion, diurnal
25036      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25037      *     transformation), and atmospheric refraction.
25038      *
25039      *  <li> The context structure astrom produced by this function is used by
25040      *     iauAtciq* and iauAticq*.
25041      *
25042      * </ol>
25043      *  Called:
25044      * <ul>
25045      *     <li>{@link #jauApcg} astrometry parameters, ICRS-GCRS, geocenter
25046      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25047      *
25048      * </ul>
25049      *@version  2013 September 25
25050      *
25051      *@since JSOFA release 20131202
25052      *
25053      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25054      */
25055     public static void jauApci(double date1, double date2,
25056             double ebpv[][], double ehp[],
25057             double x, double y, double s,
25058             Astrom astrom)
25059     {
25060 
25061         /* Star-independent astrometry parameters for geocenter. */
25062         jauApcg(date1, date2, ebpv, ehp, astrom);
25063 
25064         /* CIO based BPN matrix. */
25065         astrom.bpn = jauC2ixys(x, y, s);
25066 
25067         /* Finished. */
25068 
25069 
25070     }
25071 
25072     /**
25073      *  For a terrestrial observer, prepare star-independent astrometry
25074      *  parameters for transformations between ICRS and geocentric CIRS
25075      *  coordinates.  The caller supplies the date, and SOFA models are used
25076      *  to predict the Earth ephemeris and CIP/CIO.
25077      *
25078      *  The parameters produced by this function are required in the
25079      *  parallax, light deflection, aberration, and bias-precession-nutation
25080      *  parts of the astrometric transformation chain.
25081      *
25082      *<p>This function is derived from the International Astronomical Union's
25083      *  SOFA (Standards of Fundamental Astronomy) software collection.
25084      *
25085      *<p>Status:  support function.
25086      *
25087      *<!-- Given: -->
25088      *     @param date1   double       TDB as a 2-part...
25089      *     @param date2   double       ...Julian Date (Note 1)
25090      *     
25091      *<!-- Returned:-->
25092      *     @param astrom  jauASTROM    <b>Returned</b> star-independent astrometry parameters:
25093      *                    pmt     double         <b>Returned</b> PM time interval (SSB, Julian years)
25094      *                    eb      double[3]      <b>Returned</b> SSB to observer (vector, au)
25095      *                    eh      double[3]      <b>Returned</b> Sun to observer (unit vector)
25096      *                    em      double         <b>Returned</b> distance from Sun to observer (au)
25097      *                    v       double[3]      <b>Returned</b> barycentric observer velocity (vector, c)
25098      *                    bm1     double         <b>Returned</b> sqrt(1-|v|^2): reciprocal of Lorenz factor
25099      *                    bpn     double[3][3]   <b>Returned</b> bias-precession-nutation matrix
25100      *                    along   double         <b>Returned</b> unchanged
25101      *                    xpl     double         <b>Returned</b> unchanged
25102      *                    ypl     double         <b>Returned</b> unchanged
25103      *                    sphi    double         <b>Returned</b> unchanged
25104      *                    cphi    double         <b>Returned</b> unchanged
25105      *                    diurab  double         <b>Returned</b> unchanged
25106      *                    eral    double         <b>Returned</b> unchanged
25107      *                    refa    double         <b>Returned</b> unchanged
25108      *                    refb    double         <b>Returned</b> unchanged
25109      *     @return       double*       <b>Returned</b> equation of the origins (ERA-GST)
25110      *
25111      *<p>Notes:
25112      * <ol>
25113      *
25114      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25115      *     convenient way between the two arguments.  For example,
25116      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25117      *     others:
25118      *     <pre>
25119      *            date1          date2
25120      *
25121      *         2450123.7           0.0       (JD method)
25122      *         2451545.0       -1421.3       (J2000 method)
25123      *         2400000.5       50123.2       (MJD method)
25124      *         2450123.5           0.2       (date &amp; time method)
25125      *     </pre>
25126      *     <p>The JD method is the most natural and convenient to use in cases
25127      *     where the loss of several decimal digits of resolution is
25128      *     acceptable.  The J2000 method is best matched to the way the
25129      *     argument is handled internally and will deliver the optimum
25130      *     resolution.  The MJD method and the date &amp; time methods are both
25131      *     good compromises between resolution and convenience.  For most
25132      *     applications of this function the choice will not be at all
25133      *     critical.
25134      *
25135      *     <p>TT can be used instead of TDB without any significant impact on
25136      *     accuracy.
25137      *
25138      *  <li> All the vectors are with respect to BCRS axes.
25139      *
25140      *  <li> In cases where the caller wishes to supply his own Earth
25141      *     ephemeris and CIP/CIO, the function iauApci can be used instead
25142      *     of the present function.
25143      *
25144      *  <li> This is one of several functions that inserts into the astrom
25145      *     structure star-independent parameters needed for the chain of
25146      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25147      *
25148      *     <p>The various functions support different classes of observer and
25149      *     portions of the transformation chain:
25150      *     <pre>{@code
25151      *          functions         observer        transformation
25152      *
25153      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25154      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25155      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25156      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25157      *       iauAper iauAper13    terrestrial     update Earth rotation
25158      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25159      *     }</pre>
25160      *     <p>Those with names ending in "13" use contemporary SOFA models to
25161      *     compute the various ephemerides.  The others accept ephemerides
25162      *     supplied by the caller.
25163      *
25164      *     <p>The transformation from ICRS to GCRS covers space motion,
25165      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25166      *     comprises frame bias and precession-nutation.  From CIRS to
25167      *     observed takes account of Earth rotation, polar motion, diurnal
25168      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25169      *     transformation), and atmospheric refraction.
25170      *
25171      *  <li> The context structure astrom produced by this function is used by
25172      *     iauAtciq* and iauAticq*.
25173      *
25174      * </ol>
25175      *  Called:
25176      * <ul>
25177      *     <li>{@link #jauEpv00} Earth position and velocity
25178      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25179      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25180      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25181      *     <li>{@link #jauApci} astrometry parameters, ICRS-CIRS
25182      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25183      *
25184      * </ul>
25185      *@version  2013 October 9
25186      *
25187      *@since JSOFA release 20131202
25188      *
25189      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25190      */
25191     public static double jauApci13(double date1, double date2,
25192             Astrom astrom)
25193     {
25194         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3], r[][], s;
25195 
25196 
25197         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25198         jauEpv00(date1, date2, ehpv, ebpv);
25199 
25200         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25201         r = jauPnm06a(date1, date2);
25202 
25203         /* Extract CIP X,Y. */
25204         CelestialIntermediatePole cip = jauBpn2xy(r);
25205 
25206         /* Obtain CIO locator s. */
25207         s = jauS06(date1, date2, cip.x, cip.y);
25208 
25209         /* Compute the star-independent astrometry parameters. */
25210         jauApci(date1, date2, ebpv, ehpv[0], cip.x, cip.y, s, astrom);
25211 
25212         /* Equation of the origins. */
25213         return jauEors(r, s);
25214 
25215         /* Finished. */
25216 
25217 
25218     }
25219 
25220     /**
25221      *  For a terrestrial observer, prepare star-independent astrometry
25222      *  parameters for transformations between ICRS and observed
25223      *  coordinates.  The caller supplies the Earth ephemeris, the Earth
25224      *  rotation information and the refraction constants as well as the
25225      *  site coordinates.
25226      *
25227      *<p>This function is derived from the International Astronomical Union's
25228      *  SOFA (Standards of Fundamental Astronomy) software collection.
25229      *
25230      *<p>Status:  support function.
25231      *
25232      *<!-- Given: -->
25233      *     @param date1   double        TDB as a 2-part...
25234      *     @param date2   double        ...Julian Date (Note 1)
25235      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day, Note 2)
25236      *     @param ehp     double[3]     Earth heliocentric P (au, Note 2)
25237      *     @param x double        CIP X,Y (components of unit vector)
25238      *     @param y double        CIP X,Y (components of unit vector) 
25239      *     @param s       double        the CIO locator s (radians)
25240      *     @param theta   double        Earth rotation angle (radians)
25241      *     @param elong   double        longitude (radians, east +ve, Note 3)
25242      *     @param phi     double        latitude (geodetic, radians, Note 3)
25243      *     @param hm      double        height above ellipsoid (m, geodetic, Note 3)
25244      *     @param xp double        polar motion coordinates (radians, Note 4)
25245      *     @param yp double        polar motion coordinates (radians, Note 4) 
25246      *     @param sp      double        the TIO locator s' (radians, Note 4)
25247      *     @param refa    double        refraction constant A (radians, Note 5)
25248      *     @param refb    double        refraction constant B (radians, Note 5)
25249      *
25250      *<!-- Returned:-->
25251      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25252      *
25253      *<p>Notes:
25254      * <ol>
25255      *
25256      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25257      *     convenient way between the two arguments.  For example,
25258      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25259      *     others:
25260      *     <pre>
25261      *            date1          date2
25262      *
25263      *         2450123.7           0.0       (JD method)
25264      *         2451545.0       -1421.3       (J2000 method)
25265      *         2400000.5       50123.2       (MJD method)
25266      *         2450123.5           0.2       (date &amp; time method)
25267      *     </pre>
25268      *     <p>The JD method is the most natural and convenient to use in cases
25269      *     where the loss of several decimal digits of resolution is
25270      *     acceptable.  The J2000 method is best matched to the way the
25271      *     argument is handled internally and will deliver the optimum
25272      *     resolution.  The MJD method and the date &amp; time methods are both
25273      *     good compromises between resolution and convenience.  For most
25274      *     applications of this function the choice will not be at all
25275      *     critical.
25276      *
25277      *     <p>TT can be used instead of TDB without any significant impact on
25278      *     accuracy.
25279      *
25280      *  <li> The vectors eb, eh, and all the astrom vectors, are with respect
25281      *     to BCRS axes.
25282      *
25283      *  <li> The geographical coordinates are with respect to the WGS84
25284      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN
25285      *     CONVENTION:  the longitude required by the present function is
25286      *     right-handed, i.e. east-positive, in accordance with geographical
25287      *     convention.
25288      *
25289      *  <li> xp and yp are the coordinates (in radians) of the Celestial
25290      *     Intermediate Pole with respect to the International Terrestrial
25291      *     Reference System (see IERS Conventions), measured along the
25292      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
25293      *     s', in radians, which positions the Terrestrial Intermediate
25294      *     Origin on the equator.  For many applications, xp, yp and
25295      *     (especially) sp can be set to zero.
25296      *
25297      *     <p>Internally, the polar motion is stored in a form rotated onto the
25298      *     local meridian.
25299      *
25300      *  <li> The refraction constants refa and refb are for use in a
25301      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
25302      *     (i.e. refracted) zenith distance and dZ is the amount of
25303      *     refraction.
25304      *
25305      *  <li> It is advisable to take great care with units, as even unlikely
25306      *     values of the input parameters are accepted and processed in
25307      *     accordance with the models used.
25308      *
25309      *  <li> In cases where the caller does not wish to provide the Earth
25310      *     Ephemeris, the Earth rotation information and refraction
25311      *     constants, the function iauApco13 can be used instead of the
25312      *     present function.  This starts from UTC and weather readings etc.
25313      *     and computes suitable values using other SOFA functions.
25314      *
25315      *  <li> This is one of several functions that inserts into the astrom
25316      *     structure star-independent parameters needed for the chain of
25317      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25318      *
25319      *     <p>The various functions support different classes of observer and
25320      *     portions of the transformation chain:
25321      *     <pre>{@code
25322      *          functions         observer        transformation
25323      *
25324      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25325      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25326      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25327      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25328      *       iauAper iauAper13    terrestrial     update Earth rotation
25329      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25330      *     }</pre>
25331      *     <p>Those with names ending in "13" use contemporary SOFA models to
25332      *     compute the various ephemerides.  The others accept ephemerides
25333      *     supplied by the caller.
25334      *
25335      *     <p>The transformation from ICRS to GCRS covers space motion,
25336      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25337      *     comprises frame bias and precession-nutation.  From CIRS to
25338      *     observed takes account of Earth rotation, polar motion, diurnal
25339      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25340      *     transformation), and atmospheric refraction.
25341      *
25342      *  <li> The context structure astrom produced by this function is used by
25343      *     iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25344      *
25345      * </ol>
25346      *  Called:
25347      * <ul>
25348      *     <li>{@link #jauAper} astrometry parameters: update ERA
25349      *     <li>{@link #jauC2ixys} celestial-to-intermediate matrix, given X,Y and s
25350      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
25351      *     <li>{@link #jauTrxpv} product of transpose of r-matrix and pv-vector
25352      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
25353      *     <li>{@link #jauCr} copy r-matrix
25354      *
25355      * </ul>
25356      *@version  2013 October 9
25357      *
25358      *@since JSOFA release 20131202
25359      *
25360      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25361      * @throws JSOFAInternalError an internal error has occured
25362      * @throws JSOFAIllegalParameter 
25363      */
25364     public static void jauApco(double date1, double date2,
25365             double ebpv[][], double ehp[],
25366             double x, double y, double s, double theta,
25367             double elong, double phi, double hm,
25368             double xp, double yp, double sp,
25369             double refa, double refb,
25370             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
25371     {
25372         double sl, cl, r[][], pvc[][], pv[][];
25373 
25374 
25375         /* Longitude with adjustment for TIO locator s'. */
25376         astrom.along = elong + sp;
25377 
25378         /* Polar motion, rotated onto the local meridian. */
25379         sl = sin(astrom.along);
25380         cl = cos(astrom.along);
25381         astrom.xpl = xp*cl - yp*sl;
25382         astrom.ypl = xp*sl + yp*cl;
25383 
25384         /* Functions of latitude. */
25385         astrom.sphi = sin(phi);
25386         astrom.cphi = cos(phi);
25387 
25388         /* Refraction constants. */
25389         astrom.refa = refa;
25390         astrom.refb = refb;
25391 
25392         /* Local Earth rotation angle. */
25393         jauAper(theta, astrom);
25394 
25395         /* Disable the (redundant) diurnal aberration step. */
25396         astrom.diurab = 0.0;
25397 
25398         /* CIO based BPN matrix. */
25399         r = jauC2ixys(x, y, s);
25400 
25401         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
25402         pvc = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
25403 
25404         /* Rotate into GCRS. */
25405         pv = jauTrxpv(r, pvc);
25406 
25407         /* ICRS <-> GCRS parameters. */
25408         jauApcs(date1, date2, pv, ebpv, ehp, astrom);
25409 
25410         /* Store the CIO based BPN matrix. */
25411         jauCr(r, astrom.bpn );
25412 
25413         /* Finished. */
25414 
25415 
25416     }
25417 
25418     /**
25419      *  For a terrestrial observer, prepare star-independent astrometry
25420      *  parameters for transformations between ICRS and observed
25421      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
25422      *  conditions and observing wavelength, and SOFA models are used to
25423      *  obtain the Earth ephemeris, CIP/CIO and refraction constants.
25424      *
25425      *  The parameters produced by this function are required in the
25426      *  parallax, light deflection, aberration, and bias-precession-nutation
25427      *  parts of the ICRS/CIRS transformations.
25428      *
25429      *<p>This function is derived from the International Astronomical Union's
25430      *  SOFA (Standards of Fundamental Astronomy) software collection.
25431      *
25432      *<p>Status:  support function.
25433      *
25434      *<!-- Given: -->
25435      *     @param utc1    double      UTC as a 2-part...
25436      *     @param utc2    double      ...quasi Julian Date (Notes 1,2)
25437      *     @param dut1    double      UT1-UTC (seconds, Note 3)
25438      *     @param elong   double      longitude (radians, east +ve, Note 4)
25439      *     @param phi     double      latitude (geodetic, radians, Note 4)
25440      *     @param hm      double      height above ellipsoid (m, geodetic, Notes 4,6)
25441      *     @param xp double      polar motion coordinates (radians, Note 5)
25442      *     @param yp double      polar motion coordinates (radians, Note 5) 
25443      *     @param phpa    double      pressure at the observer (hPa = mB, Note 6)
25444      *     @param tc      double      ambient temperature at the observer (deg C)
25445      *     @param rh      double      relative humidity at the observer (range 0-1)
25446      *     @param wl      double      wavelength (micrometers, Note 7)
25447      *
25448      *<!-- Returned:-->
25449      *     @param astrom     <b>Returned</b> star-independent astrometry parameters:
25450      *         
25451      *     
25452      *     @return       double      <b>Returned</b> equation of the origins (ERA-GST)
25453      *
25454      *  @throws JSOFAInternalError an internal error has occured
25455      *  @throws JSOFAIllegalParameter
25456      *             int         status:   <b>Returned</b> +1 = dubious year (Note 2)
25457      *                                 0  =   <b>Returned</b> OK
25458      *                                -1  =   <b>Returned</b> unacceptable date
25459      *
25460      *<p>Notes:
25461      * <ol>
25462      *
25463      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
25464      *      convenient way between the two arguments, for example where utc1
25465      *      is the Julian Day Number and utc2 is the fraction of a day.
25466      *
25467      *      <p>However, JD cannot unambiguously represent UTC during a leap
25468      *      second unless special measures are taken.  The convention in the
25469      *      present function is that the JD day represents UTC days whether
25470      *      the length is 86399, 86400 or 86401 SI seconds.
25471      *
25472      *      <p>Applications should use the function iauDtf2d to convert from
25473      *      calendar date and time of day into 2-part quasi Julian Date, as
25474      *      it implements the leap-second-ambiguity convention just
25475      *      described.
25476      *
25477      *  <li> The warning status "dubious year" flags UTCs that predate the
25478      *      introduction of the time scale or that are too far in the
25479      *      future to be trusted.  See iauDat for further details.
25480      *
25481      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
25482      *      one second at the end of each positive UTC leap second,
25483      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
25484      *      practice is under review, and in the future UT1-UTC may grow
25485      *      essentially without limit.
25486      *
25487      *  <li> The geographical coordinates are with respect to the WGS84
25488      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
25489      *      longitude required by the present function is east-positive
25490      *      (i.e. right-handed), in accordance with geographical convention.
25491      *
25492      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
25493      *      values are the coordinates (in radians) of the Celestial
25494      *      Intermediate Pole with respect to the International Terrestrial
25495      *      Reference System (see IERS Conventions 2003), measured along the
25496      *      meridians 0 and 90 deg west respectively.  For many
25497      *      applications, xp and yp can be set to zero.
25498      *
25499      *      <p>Internally, the polar motion is stored in a form rotated onto
25500      *      the local meridian.
25501      *
25502      *  <li> If hm, the height above the ellipsoid of the observing station
25503      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
25504      *      available, an adequate estimate of hm can be obtained from the
25505      *      expression
25506      *
25507      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
25508      *
25509      *      <p>where tsl is the approximate sea-level air temperature in K
25510      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
25511      *      52).  Similarly, if the pressure phpa is not known, it can be
25512      *      estimated from the height of the observing station, hm, as
25513      *      follows:
25514      *
25515      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
25516      *
25517      *      <p>Note, however, that the refraction is nearly proportional to
25518      *      the pressure and that an accurate phpa value is important for
25519      *      precise work.
25520      *
25521      *  <li> The argument wl specifies the observing wavelength in
25522      *      micrometers.  The transition from optical to radio is assumed to
25523      *      occur at 100 micrometers (about 3000 GHz).
25524      *
25525      *  <li> It is advisable to take great care with units, as even unlikely
25526      *      values of the input parameters are accepted and processed in
25527      *      accordance with the models used.
25528      *
25529      *  <li> In cases where the caller wishes to supply his own Earth
25530      *      ephemeris, Earth rotation information and refraction constants,
25531      *      the function iauApco can be used instead of the present function.
25532      *
25533      *  <li> This is one of several functions that inserts into the astrom
25534      *      structure star-independent parameters needed for the chain of
25535      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25536      *
25537      *      <p>The various functions support different classes of observer and
25538      *      portions of the transformation chain:
25539      *      <pre>{@code
25540      *          functions         observer        transformation
25541      *
25542      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25543      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25544      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25545      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25546      *       iauAper iauAper13    terrestrial     update Earth rotation
25547      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25548      *      }</pre>
25549      *      <p>Those with names ending in "13" use contemporary SOFA models to
25550      *      compute the various ephemerides.  The others accept ephemerides
25551      *      supplied by the caller.
25552      *
25553      *      <p>The transformation from ICRS to GCRS covers space motion,
25554      *      parallax, light deflection, and aberration.  From GCRS to CIRS
25555      *      comprises frame bias and precession-nutation.  From CIRS to
25556      *      observed takes account of Earth rotation, polar motion, diurnal
25557      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25558      *      transformation), and atmospheric refraction.
25559      *
25560      *  <li> The context structure astrom produced by this function is used
25561      *      by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
25562      *
25563      * </ol>
25564      *  Called:
25565      * <ul>
25566      *     <li>{@link #jauUtctai} UTC to TAI
25567      *     <li>{@link #jauTaitt} TAI to TT
25568      *     <li>{@link #jauUtcut1} UTC to UT1
25569      *     <li>{@link #jauEpv00} Earth position and velocity
25570      *     <li>{@link #jauPnm06a} classical NPB matrix, IAU 2006/2000A
25571      *     <li>{@link #jauBpn2xy} extract CIP X,Y coordinates from NPB matrix
25572      *     <li>{@link #jauS06} the CIO locator s, given X,Y, IAU 2006
25573      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
25574      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
25575      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
25576      *     <li>{@link #jauApco} astrometry parameters, ICRS-observed
25577      *     <li>{@link #jauEors} equation of the origins, given NPB matrix and s
25578      *
25579      * </ul>
25580      *@version  2013 December 5
25581      *
25582      *@since JSOFA release 20131202
25583      *
25584      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25585      * @throws JSOFAInternalError an internal error has occured
25586      * @throws JSOFAIllegalParameter 
25587      */
25588     public static double jauApco13(double utc1, double utc2, double dut1,
25589             double elong, double phi, double hm, double xp, double yp,
25590             double phpa, double tc, double rh, double wl,
25591             Astrom astrom ) throws JSOFAIllegalParameter, JSOFAInternalError
25592     {
25593         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3],
25594         r[][], s, theta, sp;
25595         double eo;
25596 
25597 
25598         /* UTC to other time scales. */
25599         JulianDate tai = jauUtctai(utc1, utc2);
25600         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
25601         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
25602 
25603         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25604         jauEpv00(tt.djm0, tt.djm1, ehpv, ebpv);
25605 
25606         /* Form the equinox based BPN matrix, IAU 2006/2000A. */
25607         r = jauPnm06a(tt.djm0, tt.djm1);
25608 
25609         /* Extract CIP X,Y. */
25610         CelestialIntermediatePole cip = jauBpn2xy(r);
25611 
25612         /* Obtain CIO locator s. */
25613         s = jauS06(tt.djm0, tt.djm1, cip.x, cip.y);
25614 
25615         /* Earth rotation angle. */
25616         theta = jauEra00(ut1.djm0, ut1.djm1);
25617 
25618         /* TIO locator s'. */
25619         sp = jauSp00(tt.djm0, tt.djm1);
25620 
25621         /* Refraction constants A and B. */
25622         RefCos ref = jauRefco(phpa, tc, rh, wl);
25623 
25624         /* Compute the star-independent astrometry parameters. */
25625         jauApco(tt.djm0, tt.djm1, ebpv, ehpv[0], cip.x, cip.y, s, theta,
25626                 elong, phi, hm, xp, yp, sp, ref.a, ref.b, astrom);
25627 
25628         /* Equation of the origins. */
25629         eo = jauEors(r, s);
25630 
25631         return eo;
25632 
25633         /* Finished. */
25634 
25635 
25636     }
25637 
25638     /**
25639      *  For an observer whose geocentric position and velocity are known,
25640      *  prepare star-independent astrometry parameters for transformations
25641      *  between ICRS and GCRS.  The Earth ephemeris is supplied by the
25642      *  caller.
25643      *
25644      *  The parameters produced by this function are required in the space
25645      *  motion, parallax, light deflection and aberration parts of the
25646      *  astrometric transformation chain.
25647      *
25648      *<p>This function is derived from the International Astronomical Union's
25649      *  SOFA (Standards of Fundamental Astronomy) software collection.
25650      *
25651      *<p>Status:  support function.
25652      *
25653      *<!-- Given: -->
25654      *     @param date1   double        TDB as a 2-part...
25655      *     @param date2   double        ...Julian Date (Note 1)
25656      *     @param pv      double[2][3]  observer's geocentric pos/vel (m, m/s)
25657      *     @param ebpv    double[2][3]  Earth barycentric PV (au, au/day)
25658      *     @param ehp     double[3]     Earth heliocentric P (au)
25659      *
25660      *<!-- Returned:-->
25661      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25662 
25663      *<p>Notes:
25664      * <ol>
25665      *
25666      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25667      *     convenient way between the two arguments.  For example,
25668      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25669      *     others:
25670      *     <pre>
25671      *         date1          date2
25672      *
25673      *         2450123.7           0.0       (JD method)
25674      *         2451545.0       -1421.3       (J2000 method)
25675      *         2400000.5       50123.2       (MJD method)
25676      *         2450123.5           0.2       (date &amp; time method)
25677      *     </pre>
25678      *     <p>The JD method is the most natural and convenient to use in cases
25679      *     where the loss of several decimal digits of resolution is
25680      *     acceptable.  The J2000 method is best matched to the way the
25681      *     argument is handled internally and will deliver the optimum
25682      *     resolution.  The MJD method and the date &amp; time methods are both
25683      *     good compromises between resolution and convenience.  For most
25684      *     applications of this function the choice will not be at all
25685      *     critical.
25686      *
25687      *     <p>TT can be used instead of TDB without any significant impact on
25688      *     accuracy.
25689      *
25690      *  <li> All the vectors are with respect to BCRS axes.
25691      *
25692      *  <li> Providing separate arguments for (i) the observer's geocentric
25693      *     position and velocity and (ii) the Earth ephemeris is done for
25694      *     convenience in the geocentric, terrestrial and Earth orbit cases.
25695      *     For deep space applications it maybe more convenient to specify
25696      *     zero geocentric position and velocity and to supply the
25697      *     observer's position and velocity information directly instead of
25698      *     with respect to the Earth.  However, note the different units:
25699      *     m and m/s for the geocentric vectors, au and au/day for the
25700      *     heliocentric and barycentric vectors.
25701      *
25702      *  <li> In cases where the caller does not wish to provide the Earth
25703      *     ephemeris, the function iauApcs13 can be used instead of the
25704      *     present function.  This computes the Earth ephemeris using the
25705      *     SOFA function iauEpv00.
25706      *
25707      *  <li> This is one of several functions that inserts into the astrom
25708      *     structure star-independent parameters needed for the chain of
25709      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25710      *
25711      *     <p>The various functions support different classes of observer and
25712      *     portions of the transformation chain:
25713      *
25714      *     <pre>{@code
25715      *          functions         observer        transformation
25716      *
25717      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25718      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25719      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25720      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25721      *       iauAper iauAper13    terrestrial     update Earth rotation
25722      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25723      *     }</pre>
25724      *     <p>Those with names ending in "13" use contemporary SOFA models to
25725      *     compute the various ephemerides.  The others accept ephemerides
25726      *     supplied by the caller.
25727      *
25728      *     <p>The transformation from ICRS to GCRS covers space motion,
25729      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25730      *     comprises frame bias and precession-nutation.  From CIRS to
25731      *     observed takes account of Earth rotation, polar motion, diurnal
25732      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25733      *     transformation), and atmospheric refraction.
25734      *
25735      *  <li> The context structure astrom produced by this function is used by
25736      *     iauAtciq* and iauAticq*.
25737      *
25738      * </ol>
25739      *  Called:
25740      * <ul>
25741      *     <li>{@link #jauCp} copy p-vector
25742      *     <li>{@link #jauPm} modulus of p-vector
25743      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
25744      *     <li>{@link #jauIr} initialize r-matrix to identity
25745      *
25746      * </ul>
25747      *@version  2013 October 9
25748      *
25749      *@since JSOFA release 20131202
25750      *
25751      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25752      */
25753     public static void jauApcs(double date1, double date2, double pv[][],
25754             double ebpv[][], double ehp[],
25755             Astrom astrom)
25756     {
25757         /* au/d to m/s */
25758         final double AUDMS = DAU/DAYSEC;
25759 
25760         /* Light time for 1 au (day) */
25761         final double CR = AULT/DAYSEC;
25762 
25763         int i;
25764         double dp, dv, pb[] = new double[3], vb[] = new double[3], ph[] = new double[3], v2, w;
25765 
25766 
25767         /* Time since reference epoch, years (for proper motion calculation). */
25768         astrom.pmt = ( (date1 - DJ00) + date2 ) / DJY;
25769 
25770         /* Adjust Earth ephemeris to observer. */
25771         for (i = 0; i < 3; i++) {
25772             dp = pv[0][i] / DAU;
25773             dv = pv[1][i] / AUDMS;
25774             pb[i] = ebpv[0][i] + dp;
25775             vb[i] = ebpv[1][i] + dv;
25776             ph[i] = ehp[i] + dp;
25777         }
25778 
25779         /* Barycentric position of observer (au). */
25780         jauCp(pb, astrom.eb);
25781 
25782         /* Heliocentric direction and distance (unit vector and au). */
25783         NormalizedVector nv = jauPn(ph);
25784         
25785         astrom.em = nv.r;
25786         astrom.eh = nv.u;
25787 
25788         /* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
25789         v2 = 0.0;
25790         for (i = 0; i < 3; i++) {
25791             w = vb[i] * CR;
25792             astrom.v[i] = w;
25793             v2 += w*w;
25794         }
25795         astrom.bm1 = sqrt(1.0 - v2);
25796 
25797         /* Reset the NPB matrix. */
25798         jauIr(astrom.bpn);
25799 
25800         /* Finished. */
25801 
25802 
25803     }
25804 
25805     /**
25806      *  For an observer whose geocentric position and velocity are known,
25807      *  prepare star-independent astrometry parameters for transformations
25808      *  between ICRS and GCRS.  The Earth ephemeris is from SOFA models.
25809      *
25810      *  The parameters produced by this function are required in the space
25811      *  motion, parallax, light deflection and aberration parts of the
25812      *  astrometric transformation chain.
25813      *
25814      *<p>This function is derived from the International Astronomical Union's
25815      *  SOFA (Standards of Fundamental Astronomy) software collection.
25816      *
25817      *<p>Status:  support function.
25818      *
25819      *<!-- Given: -->
25820      *     @param date1   double        TDB as a 2-part...
25821      *     @param date2   double        ...Julian Date (Note 1)
25822      *     @param pv      double[2][3]  observer's geocentric pos/vel (Note 3)
25823      *
25824      *<!-- Returned:-->
25825      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
25826      *
25827      *<p>Notes:
25828      * <ol>
25829      *
25830      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
25831      *     convenient way between the two arguments.  For example,
25832      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
25833      *     others:
25834      *     <pre>
25835      *           date1          date2
25836      *
25837      *         2450123.7           0.0       (JD method)
25838      *         2451545.0       -1421.3       (J2000 method)
25839      *         2400000.5       50123.2       (MJD method)
25840      *         2450123.5           0.2       (date &amp; time method)
25841      *     </pre>
25842      *     <p>The JD method is the most natural and convenient to use in cases
25843      *     where the loss of several decimal digits of resolution is
25844      *     acceptable.  The J2000 method is best matched to the way the
25845      *     argument is handled internally and will deliver the optimum
25846      *     resolution.  The MJD method and the date &amp; time methods are both
25847      *     good compromises between resolution and convenience.  For most
25848      *     applications of this function the choice will not be at all
25849      *     critical.
25850      *
25851      *     <p>TT can be used instead of TDB without any significant impact on
25852      *     accuracy.
25853      *
25854      *  <li> All the vectors are with respect to BCRS axes.
25855      *
25856      *  <li> The observer's position and velocity pv are geocentric but with
25857      *     respect to BCRS axes, and in units of m and m/s.  No assumptions
25858      *     are made about proximity to the Earth, and the function can be
25859      *     used for deep space applications as well as Earth orbit and
25860      *     terrestrial.
25861      *
25862      *  <li> In cases where the caller wishes to supply his own Earth
25863      *     ephemeris, the function iauApcs can be used instead of the present
25864      *     function.
25865      *
25866      *  <li> This is one of several functions that inserts into the astrom
25867      *     structure star-independent parameters needed for the chain of
25868      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25869      *
25870      *     <p>The various functions support different classes of observer and
25871      *     portions of the transformation chain:
25872      *     <pre>{@code
25873      *          functions         observer        transformation
25874      *
25875      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25876      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25877      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25878      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25879      *       iauAper iauAper13    terrestrial     update Earth rotation
25880      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25881      *     }</pre>
25882      *     <p>Those with names ending in "13" use contemporary SOFA models to
25883      *     compute the various ephemerides.  The others accept ephemerides
25884      *     supplied by the caller.
25885      *
25886      *     <p>The transformation from ICRS to GCRS covers space motion,
25887      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25888      *     comprises frame bias and precession-nutation.  From CIRS to
25889      *     observed takes account of Earth rotation, polar motion, diurnal
25890      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25891      *     transformation), and atmospheric refraction.
25892      *
25893      *  <li> The context structure astrom produced by this function is used by
25894      *     iauAtciq* and iauAticq*.
25895      *
25896      * </ol>
25897      *  Called:
25898      * <ul>
25899      *     <li>{@link #jauEpv00} Earth position and velocity
25900      *     <li>{@link #jauApcs} astrometry parameters, ICRS-GCRS, space observer
25901      *
25902      * </ul>
25903      *@version  2013 October 9
25904      *
25905      *@since JSOFA release 20131202
25906      *
25907      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
25908      */
25909     public static void jauApcs13(double date1, double date2, double pv[][],
25910             Astrom astrom)
25911     {
25912         double ehpv[][] = new double[2][3], ebpv[][] = new double[2][3];
25913 
25914 
25915         /* Earth barycentric &amp; heliocentric position/velocity (au, au/d). */
25916         jauEpv00(date1, date2, ehpv, ebpv);
25917 
25918         /* Compute the star-independent astrometry parameters. */
25919         jauApcs(date1, date2, pv, ebpv, ehpv[0], astrom);
25920 
25921         /* Finished. */
25922 
25923 
25924     }
25925 
25926     /**
25927      *  In the star-independent astrometry parameters, update only the
25928      *  Earth rotation angle, supplied by the caller explicitly.
25929      *
25930      *<p>This function is derived from the International Astronomical Union's
25931      *  SOFA (Standards of Fundamental Astronomy) software collection.
25932      *
25933      *<p>Status:  support function.
25934      *
25935      *<!-- Given: -->
25936      *     @param theta    double       Earth rotation angle (radians, Note 2)
25937      *     @param astrom  Astrom    star-independent astrometry parameters:{@code
25938      *          pmt     double        not used
25939      *          eb      double[3]     not used
25940      *          eh      double[3]     not used
25941      *          em      double        not used
25942      *          v       double[3]     not used
25943      *          bm1     double        not used
25944      *          bpn     double[3][3]  not used
25945      *          along   double        longitude + s' (radians)
25946      *          xpl     double        not used
25947      *          ypl     double        not used
25948      *          sphi    double        not used
25949      *          cphi    double        not used
25950      *          diurab  double        not used
25951      *          eral    double        not used
25952      *          refa    double        not used
25953      *          refb    double        not used}
25954      *
25955      *<!-- Returned:-->
25956      *     astrom       <b>Returned</b> star-independent astrometry parameters:
25957     *
25958      *<p>Notes:
25959      * <ol>
25960      *
25961      *  <li> This function exists to enable sidereal-tracking applications to
25962      *     avoid wasteful recomputation of the bulk of the astrometry
25963      *     parameters:  only the Earth rotation is updated.
25964      *
25965      *  <li> For targets expressed as equinox based positions, such as
25966      *     classical geocentric apparent (RA,Dec), the supplied theta can be
25967      *     Greenwich apparent sidereal time rather than Earth rotation
25968      *     angle.
25969      *
25970      *  <li> The function iauAper13 can be used instead of the present
25971      *     function, and starts from UT1 rather than ERA itself.
25972      *
25973      *  <li> This is one of several functions that inserts into the astrom
25974      *     structure star-independent parameters needed for the chain of
25975      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
25976      *
25977      *     <p>The various functions support different classes of observer and
25978      *     portions of the transformation chain:
25979      *     <pre>{@code
25980      *          functions         observer        transformation
25981      *
25982      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
25983      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
25984      *       iauApco iauApco13    terrestrial     ICRS <-> observed
25985      *       iauApcs iauApcs13    space           ICRS <-> GCRS
25986      *       iauAper iauAper13    terrestrial     update Earth rotation
25987      *       iauApio iauApio13    terrestrial     CIRS <-> observed
25988      *     }</pre>
25989      *     <p>Those with names ending in "13" use contemporary SOFA models to
25990      *     compute the various ephemerides.  The others accept ephemerides
25991      *     supplied by the caller.
25992      *
25993      *     <p>The transformation from ICRS to GCRS covers space motion,
25994      *     parallax, light deflection, and aberration.  From GCRS to CIRS
25995      *     comprises frame bias and precession-nutation.  From CIRS to
25996      *     observed takes account of Earth rotation, polar motion, diurnal
25997      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
25998      *     transformation), and atmospheric refraction.
25999      *
26000      * </ol>
26001      *@version  2013 September 25
26002      *
26003      *@since JSOFA release 20131202
26004      *
26005      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26006      */
26007     public static void jauAper(double theta, Astrom astrom)
26008     {
26009         astrom.eral = theta + astrom.along;
26010 
26011         /* Finished. */
26012 
26013 
26014     }
26015 
26016     /**
26017      *  In the star-independent astrometry parameters, update only the
26018      *  Earth rotation angle.  The caller provides UT1, (n.b. not UTC).
26019      *
26020      *<p>This function is derived from the International Astronomical Union's
26021      *  SOFA (Standards of Fundamental Astronomy) software collection.
26022      *
26023      *<p>Status:  support function.
26024      *
26025      *<!-- Given: -->
26026      *     @param ut11     double       UT1 as a 2-part...
26027      *     @param ut12     double       ...Julian Date (Note 1)
26028      *     @param astrom      star-independent astrometry parameters:
26029      *                    pmt     double        not used
26030      *                    eb      double[3]     not used
26031      *                    eh      double[3]     not used
26032      *                    em      double        not used
26033      *                    v       double[3]     not used
26034      *                    bm1     double        not used
26035      *                    bpn     double[3][3]  not used
26036      *                    along   double        longitude + s' (radians)
26037      *                    xpl     double        not used
26038      *                    ypl     double        not used
26039      *                    sphi    double        not used
26040      *                    cphi    double        not used
26041      *                    diurab  double        not used
26042      *                    eral    double        not used
26043      *                    refa    double        not used
26044      *                    refb    double        not used
26045      *
26046      *<!-- Returned:-->
26047      *     @param astrom       <b>Returned</b> star-independent astrometry parameters:
26048      *
26049      *<p>Notes:
26050      * <ol>
26051      *
26052      *  <li> The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
26053      *     apportioned in any convenient way between the arguments ut11 and
26054      *     ut12.  For example, JD(UT1)=2450123.7 could be expressed in any
26055      *     of these ways, among others:
26056      *
26057      *            <p>ut11           ut12
26058      *
26059      *         2450123.7           0.0       (JD method)
26060      *         2451545.0       -1421.3       (J2000 method)
26061      *         2400000.5       50123.2       (MJD method)
26062      *         2450123.5           0.2       (date &amp; time method)
26063      *
26064      *     <p>The JD method is the most natural and convenient to use in cases
26065      *     where the loss of several decimal digits of resolution is
26066      *     acceptable.  The J2000 and MJD methods are good compromises
26067      *     between resolution and convenience.  The date &amp; time method is
26068      *     best matched to the algorithm used:  maximum precision is
26069      *     delivered when the ut11 argument is for 0hrs UT1 on the day in
26070      *     question and the ut12 argument lies in the range 0 to 1, or vice
26071      *     versa.
26072      *
26073      *  <li> If the caller wishes to provide the Earth rotation angle itself,
26074      *     the function iauAper can be used instead.  One use of this
26075      *     technique is to substitute Greenwich apparent sidereal time and
26076      *     thereby to support equinox based transformations directly.
26077      *
26078      *  <li> This is one of several functions that inserts into the astrom
26079      *     structure star-independent parameters needed for the chain of
26080      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26081      *
26082      *     <p>The various functions support different classes of observer and
26083      *     portions of the transformation chain:
26084      *     <pre>{@code
26085      *          functions         observer        transformation
26086      *
26087      *       <p>iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26088      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26089      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26090      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26091      *       iauAper iauAper13    terrestrial     update Earth rotation
26092      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26093      *     }</pre>
26094      *     <p>Those with names ending in "13" use contemporary SOFA models to
26095      *     compute the various ephemerides.  The others accept ephemerides
26096      *     supplied by the caller.
26097      *
26098      *     <p>The transformation from ICRS to GCRS covers space motion,
26099      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26100      *     comprises frame bias and precession-nutation.  From CIRS to
26101      *     observed takes account of Earth rotation, polar motion, diurnal
26102      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26103      *     transformation), and atmospheric refraction.
26104      *
26105      * </ol>
26106      *  Called:
26107      * <ul>
26108      *     <li>{@link #jauAper} astrometry parameters: update ERA
26109      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26110      *
26111      * </ul>
26112      *@version  2013 September 25
26113      *
26114      *@since JSOFA release 20131202
26115      *
26116      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26117      */
26118     public static void jauAper13(double ut11, double ut12, Astrom astrom)
26119     {
26120         jauAper(jauEra00(ut11,ut12), astrom);
26121 
26122         /* Finished. */
26123 
26124 
26125     }
26126 
26127     /**
26128      *  For a terrestrial observer, prepare star-independent astrometry
26129      *  parameters for transformations between CIRS and observed
26130      *  coordinates.  The caller supplies the Earth orientation information
26131      *  and the refraction constants as well as the site coordinates.
26132      *
26133      *<p>This function is derived from the International Astronomical Union's
26134      *  SOFA (Standards of Fundamental Astronomy) software collection.
26135      *
26136      *<p>Status:  support function.
26137      *
26138      *<!-- Given: -->
26139      *     @param sp      double       the TIO locator s' (radians, Note 1)
26140      *     @param theta   double       Earth rotation angle (radians)
26141      *     @param elong   double       longitude (radians, east +ve, Note 2)
26142      *     @param phi     double       geodetic latitude (radians, Note 2)
26143      *     @param hm      double       height above ellipsoid (m, geodetic Note 2)
26144      *     @param xp double       polar motion coordinates (radians, Note 3)
26145      *     @param yp double       polar motion coordinates (radians, Note 3) 
26146      *     @param refa    double       refraction constant A (radians, Note 4)
26147      *     @param refb    double       refraction constant B (radians, Note 4)
26148      *
26149      *<!-- Returned:-->
26150      *     @param astrom  {@link Astrom}    <b>Returned</b> star-independent astrometry parameters:
26151      *     
26152      *<p>Notes:
26153      * <ol>
26154      *
26155      *  <li> sp, the TIO locator s', is a tiny quantity needed only by the
26156      *     most precise applications.  It can either be set to zero or
26157      *     predicted using the SOFA function iauSp00.
26158      *
26159      *  <li> The geographical coordinates are with respect to the WGS84
26160      *     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26161      *     longitude required by the present function is east-positive
26162      *     (i.e. right-handed), in accordance with geographical convention.
26163      *
26164      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26165      *     values are the coordinates (in radians) of the Celestial
26166      *     Intermediate Pole with respect to the International Terrestrial
26167      *     Reference System (see IERS Conventions 2003), measured along the
26168      *     meridians 0 and 90 deg west respectively.  For many applications,
26169      *     xp and yp can be set to zero.
26170      *
26171      *     <p>Internally, the polar motion is stored in a form rotated onto the
26172      *     local meridian.
26173      *
26174      *  <li> The refraction constants refa and refb are for use in a
26175      *     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
26176      *     (i.e. refracted) zenith distance and dZ is the amount of
26177      *     refraction.
26178      *
26179      *  <li> It is advisable to take great care with units, as even unlikely
26180      *     values of the input parameters are accepted and processed in
26181      *     accordance with the models used.
26182      *
26183      *  <li> In cases where the caller does not wish to provide the Earth
26184      *     rotation information and refraction constants, the function
26185      *     iauApio13 can be used instead of the present function.  This
26186      *     starts from UTC and weather readings etc. and computes suitable
26187      *     values using other SOFA functions.
26188      *
26189      *  <li> This is one of several functions that inserts into the astrom
26190      *     structure star-independent parameters needed for the chain of
26191      *     astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26192      *
26193      *     <p>The various functions support different classes of observer and
26194      *     portions of the transformation chain:
26195      *<pre>{@code
26196      *          functions         observer        transformation
26197      *
26198      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26199      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26200      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26201      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26202      *       iauAper iauAper13    terrestrial     update Earth rotation
26203      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26204      *}</pre>
26205      *     <p>Those with names ending in "13" use contemporary SOFA models to
26206      *     compute the various ephemerides.  The others accept ephemerides
26207      *     supplied by the caller.
26208      *
26209      *     <p>The transformation from ICRS to GCRS covers space motion,
26210      *     parallax, light deflection, and aberration.  From GCRS to CIRS
26211      *     comprises frame bias and precession-nutation.  From CIRS to
26212      *     observed takes account of Earth rotation, polar motion, diurnal
26213      *     aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26214      *     transformation), and atmospheric refraction.
26215      *
26216      *  <li> The context structure astrom produced by this function is used by
26217      *     iauAtioq and iauAtoiq.
26218      *
26219      * </ol>
26220      *  Called:
26221      * <ul>
26222      *     <li>{@link #jauPvtob} position/velocity of terrestrial station
26223      *     <li>{@link #jauAper} astrometry parameters: update ERA
26224      *
26225      * </ul>
26226      *@version  2013 October 9
26227      *
26228      *@since JSOFA release 20131202
26229      *
26230      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26231      * @throws JSOFAInternalError an internal error has occured
26232      * @throws JSOFAIllegalParameter 
26233      */
26234     public static void jauApio(double sp, double theta,
26235             double elong, double phi, double hm, double xp, double yp,
26236             double refa, double refb,
26237             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26238     {
26239         double sl, cl, pv[][];
26240 
26241 
26242         /* Longitude with adjustment for TIO locator s'. */
26243         astrom.along = elong + sp;
26244 
26245         /* Polar motion, rotated onto the local meridian. */
26246         sl = sin(astrom.along);
26247         cl = cos(astrom.along);
26248         astrom.xpl = xp*cl - yp*sl;
26249         astrom.ypl = xp*sl + yp*cl;
26250 
26251         /* Functions of latitude. */
26252         astrom.sphi = sin(phi);
26253         astrom.cphi = cos(phi);
26254 
26255         /* Observer's geocentric position and velocity (m, m/s, CIRS). */
26256         pv = jauPvtob(elong, phi, hm, xp, yp, sp, theta);
26257 
26258         /* Magnitude of diurnal aberration vector. */
26259         astrom.diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
26260 
26261         /* Refraction constants. */
26262         astrom.refa = refa;
26263         astrom.refb = refb;
26264 
26265         /* Local Earth rotation angle. */
26266         jauAper(theta, astrom);
26267 
26268         /* Finished. */
26269 
26270 
26271     }
26272 
26273     /**
26274      *  For a terrestrial observer, prepare star-independent astrometry
26275      *  parameters for transformations between CIRS and observed
26276      *  coordinates.  The caller supplies UTC, site coordinates, ambient air
26277      *  conditions and observing wavelength.
26278      *
26279      *<p>This function is derived from the International Astronomical Union's
26280      *  SOFA (Standards of Fundamental Astronomy) software collection.
26281      *
26282      *<p>Status:  support function.
26283      *
26284      *<!-- Given: -->
26285      *     @param utc1    double       UTC as a 2-part...
26286      *     @param utc2    double       ...quasi Julian Date (Notes 1,2)
26287      *     @param dut1    double       UT1-UTC (seconds)
26288      *     @param elong   double       longitude (radians, east +ve, Note 3)
26289      *     @param phi     double       geodetic latitude (radians, Note 3)
26290      *     @param hm      double       height above ellipsoid (m, geodetic Notes 4,6)
26291      *     @param xp double       polar motion coordinates (radians, Note 5)
26292      *     @param yp double       polar motion coordinates (radians, Note 5) 
26293      *     @param phpa    double       pressure at the observer (hPa = mB, Note 6)
26294      *     @param tc      double       ambient temperature at the observer (deg C)
26295      *     @param rh      double       relative humidity at the observer (range 0-1)
26296      *     @param wl      double       wavelength (micrometers, Note 7)
26297      *
26298      *<!-- Returned:-->
26299      *     @param astrom      <b>Returned</b> star-independent astrometry parameters:
26300      *     @throws JSOFAInternalError an internal error has occured
26301      *     @throws JSOFAIllegalParameter
26302      *                   
26303      *             int          status:   <b>Returned</b> +1 = dubious year (Note 2)
26304      *                                  0  =   <b>Returned</b> OK
26305      *                                 -1  =   <b>Returned</b> unacceptable date
26306      *
26307      *<p>Notes:
26308      * <ol>
26309      *
26310      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
26311      *      convenient way between the two arguments, for example where utc1
26312      *      is the Julian Day Number and utc2 is the fraction of a day.
26313      *
26314      *      <p>However, JD cannot unambiguously represent UTC during a leap
26315      *      second unless special measures are taken.  The convention in the
26316      *      present function is that the JD day represents UTC days whether
26317      *      the length is 86399, 86400 or 86401 SI seconds.
26318      *
26319      *      <p>Applications should use the function iauDtf2d to convert from
26320      *      calendar date and time of day into 2-part quasi Julian Date, as
26321      *      it implements the leap-second-ambiguity convention just
26322      *      described.
26323      *
26324      *  <li> The warning status "dubious year" flags UTCs that predate the
26325      *      introduction of the time scale or that are too far in the future
26326      *      to be trusted.  See iauDat for further details.
26327      *
26328      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
26329      *      one second at the end of each positive UTC leap second,
26330      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
26331      *      practice is under review, and in the future UT1-UTC may grow
26332      *      essentially without limit.
26333      *
26334      *  <li> The geographical coordinates are with respect to the WGS84
26335      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26336      *      longitude required by the present function is east-positive
26337      *      (i.e. right-handed), in accordance with geographical convention.
26338      *
26339      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26340      *      values are the coordinates (in radians) of the Celestial
26341      *      Intermediate Pole with respect to the International Terrestrial
26342      *      Reference System (see IERS Conventions 2003), measured along the
26343      *      meridians 0 and 90 deg west respectively.  For many applications,
26344      *      xp and yp can be set to zero.
26345      *
26346      *      <p>Internally, the polar motion is stored in a form rotated onto
26347      *      the local meridian.
26348      *
26349      *  <li> If hm, the height above the ellipsoid of the observing station
26350      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
26351      *      available, an adequate estimate of hm can be obtained from the
26352      *      expression
26353      *
26354      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
26355      *
26356      *      <p>where tsl is the approximate sea-level air temperature in K
26357      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
26358      *      52).  Similarly, if the pressure phpa is not known, it can be
26359      *      estimated from the height of the observing station, hm, as
26360      *      follows:
26361      *
26362      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
26363      *
26364      *      <p>Note, however, that the refraction is nearly proportional to the
26365      *      pressure and that an accurate phpa value is important for
26366      *      precise work.
26367      *
26368      *  <li> The argument wl specifies the observing wavelength in
26369      *      micrometers.  The transition from optical to radio is assumed to
26370      *      occur at 100 micrometers (about 3000 GHz).
26371      *
26372      *  <li> It is advisable to take great care with units, as even unlikely
26373      *      values of the input parameters are accepted and processed in
26374      *      accordance with the models used.
26375      *
26376      *  <li> In cases where the caller wishes to supply his own Earth
26377      *      rotation information and refraction constants, the function
26378      *      iauApc can be used instead of the present function.
26379      *
26380      *  <li> This is one of several functions that inserts into the astrom
26381      *      structure star-independent parameters needed for the chain of
26382      *      astrometric transformations {@code ICRS <-> GCRS <-> CIRS <-> observed.}
26383      *
26384      *      <p>The various functions support different classes of observer and
26385      *      portions of the transformation chain:
26386      *      <pre>{@code
26387      *          functions         observer        transformation
26388      *
26389      *       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
26390      *       iauApci iauApci13    terrestrial     ICRS <-> CIRS
26391      *       iauApco iauApco13    terrestrial     ICRS <-> observed
26392      *       iauApcs iauApcs13    space           ICRS <-> GCRS
26393      *       iauAper iauAper13    terrestrial     update Earth rotation
26394      *       iauApio iauApio13    terrestrial     CIRS <-> observed
26395      *      }</pre>
26396      *      <p>Those with names ending in "13" use contemporary SOFA models to
26397      *      compute the various ephemerides.  The others accept ephemerides
26398      *      supplied by the caller.
26399      *
26400      *      <p>The transformation from ICRS to GCRS covers space motion,
26401      *      parallax, light deflection, and aberration.  From GCRS to CIRS
26402      *      comprises frame bias and precession-nutation.  From CIRS to
26403      *      observed takes account of Earth rotation, polar motion, diurnal
26404      *      aberration and parallax (unless subsumed into the {@code ICRS <-> GCRS}
26405      *      transformation), and atmospheric refraction.
26406      *
26407      *  <li> The context structure astrom produced by this function is used
26408      *      by iauAtioq and iauAtoiq.
26409      *
26410      * </ol>
26411      *  Called:
26412      * <ul>
26413      *     <li>{@link #jauUtctai} UTC to TAI
26414      *     <li>{@link #jauTaitt} TAI to TT
26415      *     <li>{@link #jauUtcut1} UTC to UT1
26416      *     <li>{@link #jauSp00} the TIO locator s', IERS 2000
26417      *     <li>{@link #jauEra00} Earth rotation angle, IAU 2000
26418      *     <li>{@link #jauRefco} refraction constants for given ambient conditions
26419      *     <li>{@link #jauApio} astrometry parameters, CIRS-observed
26420      *
26421      * </ul>
26422      *@version  2013 October 9
26423      *
26424      *@since JSOFA release 20131202
26425      *
26426      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26427      * @throws JSOFAInternalError an internal error has occured
26428      * @throws JSOFAIllegalParameter 
26429      */
26430     public static void jauApio13(double utc1, double utc2, double dut1,
26431             double elong, double phi, double hm, double xp, double yp,
26432             double phpa, double tc, double rh, double wl,
26433             Astrom astrom) throws JSOFAIllegalParameter, JSOFAInternalError
26434     {
26435         double sp, theta;
26436 
26437 
26438         /* UTC to other time scales. */
26439         JulianDate tai = jauUtctai(utc1, utc2);
26440         JulianDate tt = jauTaitt(tai.djm0, tai.djm1);
26441         JulianDate ut1 = jauUtcut1(utc1, utc2, dut1);
26442 
26443         /* TIO locator s'. */
26444         sp = jauSp00(tt.djm0, tt.djm1);
26445 
26446         /* Earth rotation angle. */
26447         theta = jauEra00(ut1.djm0, ut1.djm1);
26448 
26449         /* Refraction constants A and B. */
26450         RefCos refco = jauRefco(phpa, tc, rh, wl);
26451 
26452         /* CIRS <-> observed astrometry parameters. */
26453         jauApio(sp, theta, elong, phi, hm, xp, yp, refco.a, refco.b, astrom);
26454 
26455        
26456         /* Finished. */
26457 
26458 
26459     }
26460 
26461     /**
26462      *  Transform ICRS star data, epoch J2000.0, to CIRS.
26463      *
26464      *<p>This function is derived from the International Astronomical Union's
26465      *  SOFA (Standards of Fundamental Astronomy) software collection.
26466      *
26467      *<p>Status:  support function.
26468      *
26469      *<!-- Given: -->
26470      *     @param rc      double    ICRS right ascension at J2000.0 (radians, Note 1)
26471      *     @param dc      double    ICRS declination at J2000.0 (radians, Note 1)
26472      *     @param pr      double    RA proper motion (radians/year; Note 2)
26473      *     @param pd      double    Dec proper motion (radians/year)
26474      *     @param px      double    parallax (arcsec)
26475      *     @param rv      double    radial velocity (km/s, +ve if receding)
26476      *     @param date1   double    TDB as a 2-part...
26477      *     @param date2   double    ...Julian Date (Note 3)
26478      *
26479      *<!-- Returned:-->
26480      *     @return    double*    <b>Returned</b> CIRS geocentric RA,Dec (radians)
26481      *        eo      double*    <b>Returned</b> equation of the origins (ERA-GST, Note 5)
26482      *
26483      *<p>Notes:
26484      * <ol>
26485      *
26486      *  <li> Star data for an epoch other than J2000.0 (for example from the
26487      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26488      *     preliminary call to iauPmsafe before use.
26489      *
26490      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26491      *
26492      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
26493      *     convenient way between the two arguments.  For example,
26494      *     JD(TDB)=2450123.8g could be expressed in any of these ways, among
26495      *     others:
26496      *
26497      *            date1          date2
26498      *
26499      *         2450123.8g           0.0       (JD method)
26500      *         2451545.0       -1421.3       (J2000 method)
26501      *         2400000.5       50123.2       (MJD method)
26502      *         2450123.5           0.2       (date &amp; time method)
26503      *
26504      *     <p>The JD method is the most natural and convenient to use in cases
26505      *     where the loss of several decimal digits of resolution is
26506      *     acceptable.  The J2000 method is best matched to the way the
26507      *     argument is handled internally and will deliver the optimum
26508      *     resolution.  The MJD method and the date &amp; time methods are both
26509      *     good compromises between resolution and convenience.  For most
26510      *     applications of this function the choice will not be at all
26511      *     critical.
26512      *
26513      *     <p>TT can be used instead of TDB without any significant impact on
26514      *     accuracy.
26515      *
26516      *  <li> The available accuracy is better than 1 milliarcsecond, limited
26517      *     mainly by the precession-nutation model that is used, namely
26518      *     IAU 2000A/2006.  Very close to solar system bodies, additional
26519      *     errors of up to several milliarcseconds can occur because of
26520      *     unmodeled light deflection;  however, the Sun's contribution is
26521      *     taken into account, to first order.  The accuracy limitations of
26522      *     the SOFA function iauEpv00 (used to compute Earth position and
26523      *     velocity) can contribute aberration errors of up to
26524      *     5 microarcseconds.  Light deflection at the Sun's limb is
26525      *     uncertain at the 0.4 mas level.
26526      *
26527      *  <li> Should the transformation to (equinox based) apparent place be
26528      *     required rather than (CIO based) intermediate place, subtract the
26529      *     equation of the origins from the returned right ascension:
26530      *     RA = RI - EO. (The iauAnp function can then be applied, as
26531      *     required, to keep the result in the conventional 0-2pi range.)
26532      *
26533      * </ol>
26534      *  Called:
26535      * <ul>
26536      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
26537      *     <li>{@link #jauAtciq} quick ICRS to CIRS
26538      *
26539      * </ul>
26540      *@version  2013 October 9
26541      *
26542      *@since JSOFA release 20131202
26543      *
26544      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26545      */
26546     public static SphericalCoordinateEO jauAtci13(double rc, double dc,
26547             double pr, double pd, double px, double rv,
26548             double date1, double date2)
26549     {
26550         /* Star-independent astrometry parameters */
26551         Astrom astrom = new Astrom();
26552 
26553 
26554         /* The transformation parameters. */
26555         double eo = jauApci13(date1, date2, astrom);
26556 
26557         /* ICRS (epoch J2000.0) to CIRS. */
26558         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
26559         
26560         return new SphericalCoordinateEO(co, eo);
26561         /* Finished. */
26562 
26563 
26564     }
26565 
26566     /**
26567      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26568      *  star-independent astrometry parameters.
26569      *
26570      *  Use of this function is appropriate when efficiency is important and
26571      *  where many star positions are to be transformed for one date.  The
26572      *  star-independent parameters can be obtained by calling one of the
26573      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26574      *
26575      *  If the parallax and proper motions are zero the iauAtciqz function
26576      *  can be used instead.
26577      *
26578      *<p>This function is derived from the International Astronomical Union's
26579      *  SOFA (Standards of Fundamental Astronomy) software collection.
26580      *
26581      *<p>Status:  support function.
26582      *
26583      *<!-- Given: -->
26584      *     @param rc double      ICRS RA,Dec at J2000.0 (radians)
26585      *     @param dc double      ICRS RA,Dec at J2000.0 (radians) 
26586      *     @param pr      double      RA proper motion (radians/year; Note 3)
26587      *     @param pd      double      Dec proper motion (radians/year)
26588      *     @param px      double      parallax (arcsec)
26589      *     @param rv      double      radial velocity (km/s, +ve if receding)
26590      *     @param astrom    star-independent astrometry parameters:
26591      *
26592      *<!-- Returned:-->
26593      *     @return     double      <b>Returned</b> CIRS RA,Dec (radians)
26594      *
26595      *<p>Notes:
26596      * <ol>
26597      *
26598      *  <li> All the vectors are with respect to BCRS axes.
26599      *
26600      *  <li> Star data for an epoch other than J2000.0 (for example from the
26601      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26602      *     preliminary call to iauPmsafe before use.
26603      *
26604      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26605      *
26606      * </ol>
26607      *  Called:
26608      * <ul>
26609      *     <li>{@link #jauPmpx} proper motion and parallax
26610      *     <li>{@link #jauLdsun} light deflection by the Sun
26611      *     <li>{@link #jauAb} stellar aberration
26612      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26613      *     <li>{@link #jauC2s} p-vector to spherical
26614      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26615      *
26616      * </ul>
26617      *@version  2013 October 9
26618      *
26619      *@since JSOFA release 20131202
26620      *
26621      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26622      */
26623     public static SphericalCoordinate jauAtciq(double rc, double dc,
26624             double pr, double pd, double px, double rv,
26625             Astrom astrom)
26626     {
26627         double pco[], pnat[], ppr[], pi[];
26628 
26629 
26630         /* Proper motion and parallax, giving BCRS coordinate direction. */
26631         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26632 
26633         /* Light deflection by the Sun, giving BCRS natural direction. */
26634         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26635 
26636         /* Aberration, giving GCRS proper direction. */
26637         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26638 
26639         /* Bias-precession-nutation, giving CIRS proper direction. */
26640         pi = jauRxp(astrom.bpn, ppr);
26641 
26642         /* CIRS RA,Dec. */
26643         SphericalCoordinate co = jauC2s(pi);
26644         co.alpha = jauAnp(co.alpha);
26645 
26646         return co;
26647         /* Finished. */
26648 
26649 
26650     }
26651 
26652     /**
26653      *  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
26654      *  star-independent astrometry parameters plus a list of light-
26655      *  deflecting bodies.
26656      *
26657      *  Use of this function is appropriate when efficiency is important and
26658      *  where many star positions are to be transformed for one date.  The
26659      *  star-independent parameters can be obtained by calling one of the
26660      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26661      *
26662      *
26663      *  If the only light-deflecting body to be taken into account is the
26664      *  Sun, the iauAtciq function can be used instead.  If in addition the
26665      *  parallax and proper motions are zero, the iauAtciqz function can be
26666      *  used.
26667      *
26668      *<p>This function is derived from the International Astronomical Union's
26669      *  SOFA (Standards of Fundamental Astronomy) software collection.
26670      *
26671      *<p>Status:  support function.
26672      *
26673      *<!-- Given: -->
26674      *     @param rc double        ICRS RA,Dec at J2000.0 (radians)
26675      *     @param dc double        ICRS RA,Dec at J2000.0 (radians) 
26676      *     @param pr      double        RA proper motion (radians/year; Note 3)
26677      *     @param pd      double        Dec proper motion (radians/year)
26678      *     @param px      double        parallax (arcsec)
26679      *     @param rv      double        radial velocity (km/s, +ve if receding)
26680      *     @param astrom      star-independent astrometry parameters:
26681      *      @param n      int            number of bodies (Note 3)
26682      *      @param b      jauLDBODY[n]  data for each of the n bodies (Notes 3,4):
26683      *
26684      *<!-- Returned:-->
26685      *     @return ri,di    double      <b>Returned</b> CIRS RA,Dec (radians)
26686      *
26687      *<p>Notes:
26688      * <ol>
26689      *
26690      *  <li> Star data for an epoch other than J2000.0 (for example from the
26691      *     Hipparcos catalog, which has an epoch of J1991.25) will require a
26692      *     preliminary call to iauPmsafe before use.
26693      *
26694      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26695      *
26696      *  <li> The struct b contains n entries, one for each body to be
26697      *     considered.  If n = 0, no gravitational light deflection will be
26698      *     applied, not even for the Sun.
26699      *
26700      *  <li> The struct b should include an entry for the Sun as well as for
26701      *     any planet or other body to be taken into account.  The entries
26702      *     should be in the order in which the light passes the body.
26703      *
26704      *  <li> In the entry in the b struct for body i, the mass parameter
26705      *     b[i].bm can, as required, be adjusted in order to allow for such
26706      *     effects as quadrupole field.
26707      *
26708      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
26709      *     the angular separation (in radians) between star and body at
26710      *     which limiting is applied.  As phi shrinks below the chosen
26711      *     threshold, the deflection is artificially reduced, reaching zero
26712      *     for phi = 0.   Example values suitable for a terrestrial
26713      *     observer, together with masses, are as follows:
26714      *     <pre>
26715      *        body i     b[i].bm        b[i].dl
26716      *
26717      *        Sun        1.0            6e-6
26718      *        Jupiter    0.00095435     3e-9
26719      *        Saturn     0.00028574     3e-10
26720      *     </pre>
26721      *  <li> For efficiency, validation of the contents of the b array is
26722      *     omitted.  The supplied masses must be greater than zero, the
26723      *     position and velocity vectors must be right, and the deflection
26724      *     limiter greater than zero.
26725      *
26726      * </ol>
26727      *  Called:
26728      * <ul>
26729      *     <li>{@link #jauPmpx} proper motion and parallax
26730      *     <li>{@link #jauLdn} light deflection by n bodies
26731      *     <li>{@link #jauAb} stellar aberration
26732      *     <li>{@link #jauRxp} product of r-matrix and pv-vector
26733      *     <li>{@link #jauC2s} p-vector to spherical
26734      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
26735      *
26736      * </ul>
26737      *@version  2013 October 9
26738      *
26739      *@since JSOFA release 20131202
26740      *
26741      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26742      */
26743     public static SphericalCoordinate jauAtciqn(double rc, double dc, double pr, double pd,
26744             double px, double rv, Astrom astrom,
26745             int n, Ldbody b[])
26746     {
26747         double pco[], pnat[], ppr[] = new double[3], pi[] = new double[3];
26748 
26749 
26750         /* Proper motion and parallax, giving BCRS coordinate direction. */
26751         pco = jauPmpx(rc, dc, pr, pd, px, rv, astrom.pmt, astrom.eb);
26752 
26753         /* Light deflection, giving BCRS natural direction. */
26754         pnat = jauLdn(n, b, astrom.eb, pco);
26755 
26756         /* Aberration, giving GCRS proper direction. */
26757         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26758 
26759         /* Bias-precession-nutation, giving CIRS proper direction. */
26760         pi = jauRxp(astrom.bpn, ppr);
26761 
26762         /* CIRS RA,Dec. */
26763         SphericalCoordinate co = jauC2s(pi);
26764         co.alpha = jauAnp(co.alpha);
26765 
26766         return co;
26767         /* Finished. */
26768 
26769 
26770     }
26771 
26772     /**
26773      *  Quick ICRS to CIRS transformation, given precomputed star-
26774      *  independent astrometry parameters, and assuming zero parallax and
26775      *  proper motion.
26776      *
26777      *  Use of this function is appropriate when efficiency is important and
26778      *  where many star positions are to be transformed for one date.  The
26779      *  star-independent parameters can be obtained by calling one of the
26780      *  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
26781      *
26782      *  The corresponding function for the case of non-zero parallax and
26783      *  proper motion is iauAtciq.
26784      *
26785      *<p>This function is derived from the International Astronomical Union's
26786      *  SOFA (Standards of Fundamental Astronomy) software collection.
26787      *
26788      *<p>Status:  support function.
26789      *
26790      *<!-- Given: -->
26791      *     @param rc double      ICRS astrometric RA,Dec (radians)
26792      *     @param dc double      ICRS astrometric RA,Dec (radians) 
26793      *     @param astrom    star-independent astrometry parameters:
26794      *
26795      *<!-- Returned:-->
26796      *     @return ri,di   double       <b>Returned</b> CIRS RA,Dec (radians)
26797      *
26798      *  Note:
26799      *
26800      *     @return All  the   <b>Returned</b> vectors are with respect to BCRS axes.
26801      *
26802      *<p>References:
26803      * <ul>
26804      *
26805      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
26806      *     the Astronomical Almanac, 3rd ed., University Science Books
26807      *     (2013).
26808      *
26809      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
26810      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
26811      *
26812      * </ul>
26813      *  Called:
26814      * <ul>
26815      *     <li>{@link #jauS2c} spherical coordinates to unit vector
26816      *     <li>{@link #jauLdsun} light deflection due to Sun
26817      *     <li>{@link #jauAb} stellar aberration
26818      *     <li>{@link #jauRxp} product of r-matrix and p-vector
26819      *     <li>{@link #jauC2s} p-vector to spherical
26820      *     <li>{@link #jauAnp} normalize angle into range +/- pi
26821      *
26822      * </ul>
26823      *@version  2013 October 9
26824      *
26825      *@since JSOFA release 20131202
26826      *
26827      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
26828      */
26829     public static SphericalCoordinate jauAtciqz(double rc, double dc, Astrom astrom)
26830     {
26831         double pco[], pnat[], ppr[] = new double[3], pi[];
26832 
26833 
26834         /* BCRS coordinate direction (unit vector). */
26835         pco = jauS2c(rc, dc);
26836 
26837         /* Light deflection by the Sun, giving BCRS natural direction. */
26838         pnat = jauLdsun(pco, astrom.eh, astrom.em);
26839 
26840         /* Aberration, giving GCRS proper direction. */
26841         ppr = jauAb(pnat, astrom.v, astrom.em, astrom.bm1);
26842 
26843         /* Bias-precession-nutation, giving CIRS proper direction. */
26844         pi = jauRxp(astrom.bpn, ppr);
26845 
26846         /* CIRS RA,Dec. */
26847         SphericalCoordinate co = jauC2s(pi);
26848         co.alpha = jauAnp(co.alpha);
26849 
26850         return co;
26851         /* Finished. */
26852 
26853 
26854     }
26855 
26856     /**
26857      *  ICRS RA,Dec to observed place.  The caller supplies UTC, site
26858      *  coordinates, ambient air conditions and observing wavelength.
26859      *
26860      *  SOFA models are used for the Earth ephemeris, bias-precession-
26861      *  nutation, Earth orientation and refraction.
26862      *
26863      *<p>This function is derived from the International Astronomical Union's
26864      *  SOFA (Standards of Fundamental Astronomy) software collection.
26865      *
26866      *<p>Status:  support function.
26867      *
26868      *<!-- Given: -->
26869      *     @param rc double    ICRS right ascension at J2000.0 (radians, Note 1)
26870      *     @param dc double    ICRS right ascension at J2000.0 (radians, Note 1) 
26871      *     @param pr      double    RA proper motion (radians/year; Note 2)
26872      *     @param pd      double    Dec proper motion (radians/year)
26873      *     @param px      double    parallax (arcsec)
26874      *     @param rv      double    radial velocity (km/s, +ve if receding)
26875      *     @param utc1    double    UTC as a 2-part...
26876      *     @param utc2    double    ...quasi Julian Date (Notes 3-4)
26877      *     @param dut1    double    UT1-UTC (seconds, Note 5)
26878      *     @param elong   double    longitude (radians, east +ve, Note 6)
26879      *     @param phi     double    latitude (geodetic, radians, Note 6)
26880      *     @param hm      double    height above ellipsoid (m, geodetic, Notes 6,8)
26881      *     @param xp double    polar motion coordinates (radians, Note 7)
26882      *     @param yp double    polar motion coordinates (radians, Note 7) 
26883      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
26884      *     @param tc      double    ambient temperature at the observer (deg C)
26885      *     @param rh      double    relative humidity at the observer (range 0-1)
26886      *     @param wl      double    wavelength (micrometers, Note 9)
26887      *
26888      *<!-- Returned:-->
26889      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
26890      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
26891      *             hob     double*    <b>Returned</b> observed hour angle (radians)
26892      *             dob     double*    <b>Returned</b> observed declination (radians)
26893      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
26894      *             eo      double*    <b>Returned</b> equation of the origins (ERA-GST)
26895      *
26896      *  @throws JSOFAInternalError an internal error has occured
26897      *  @throws JSOFAIllegalParameter
26898      *             int       status:   <b>Returned</b> +1 = dubious year (Note 4)
26899      *                               0  =   <b>Returned</b> OK
26900      *                              -1  =   <b>Returned</b> unacceptable date
26901      *
26902      *<p>Notes:
26903      * <ol>
26904      *
26905      *  <li> Star data for an epoch other than J2000.0 (for example from the
26906      *      Hipparcos catalog, which has an epoch of J1991.25) will require
26907      *      a preliminary call to iauPmsafe before use.
26908      *
26909      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
26910      *
26911      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
26912      *      convenient way between the two arguments, for example where utc1
26913      *      is the Julian Day Number and utc2 is the fraction of a day.
26914      *
26915      *      <p>However, JD cannot unambiguously represent UTC during a leap
26916      *      second unless special measures are taken.  The convention in the
26917      *      present function is that the JD day represents UTC days whether
26918      *      the length is 86399, 86400 or 86401 SI seconds.
26919      *
26920      *      <p>Applications should use the function iauDtf2d to convert from
26921      *      calendar date and time of day into 2-part quasi Julian Date, as
26922      *      it implements the leap-second-ambiguity convention just
26923      *      described.
26924      *
26925      *  <li> The warning status "dubious year" flags UTCs that predate the
26926      *      introduction of the time scale or that are too far in the
26927      *      future to be trusted.  See iauDat for further details.
26928      *
26929      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
26930      *      one second at the end of each positive UTC leap second,
26931      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
26932      *      practice is under review, and in the future UT1-UTC may grow
26933      *      essentially without limit.
26934      *
26935      *  <li> The geographical coordinates are with respect to the WGS84
26936      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
26937      *      longitude required by the present function is east-positive
26938      *      (i.e. right-handed), in accordance with geographical convention.
26939      *
26940      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
26941      *      values are the coordinates (in radians) of the Celestial
26942      *      Intermediate Pole with respect to the International Terrestrial
26943      *      Reference System (see IERS Conventions 2003), measured along the
26944      *      meridians 0 and 90 deg west respectively.  For many
26945      *      applications, xp and yp can be set to zero.
26946      *
26947      *  <li> If hm, the height above the ellipsoid of the observing station
26948      *      in meters, is not known but phpa, the pressure in hPa (=mB),
26949      *      is available, an adequate estimate of hm can be obtained from
26950      *      the expression
26951      *
26952      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
26953      *
26954      *      <p>where tsl is the approximate sea-level air temperature in K
26955      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
26956      *      52).  Similarly, if the pressure phpa is not known, it can be
26957      *      estimated from the height of the observing station, hm, as
26958      *      follows:
26959      *
26960      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
26961      *
26962      *      <p>Note, however, that the refraction is nearly proportional to
26963      *      the pressure and that an accurate phpa value is important for
26964      *      precise work.
26965      *
26966      *  <li> The argument wl specifies the observing wavelength in
26967      *      micrometers.  The transition from optical to radio is assumed to
26968      *      occur at 100 micrometers (about 3000 GHz).
26969      *
26970      *  <li> The accuracy of the result is limited by the corrections for
26971      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
26972      *      Providing the meteorological parameters are known accurately and
26973      *      there are no gross local effects, the predicted observed
26974      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
26975      *      (radio) for a zenith distance of less than 70 degrees, better
26976      *      than 30 arcsec (optical or radio) at 85 degrees and better
26977      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
26978      *
26979      *      <p>Without refraction, the complementary functions iauAtco13 and
26980      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
26981      *      all over the celestial sphere.  With refraction included,
26982      *      consistency falls off at high zenith distances, but is still
26983      *      better than 0.05 arcsec at 85 degrees.
26984      *
26985      *  <li> "Observed" Az,ZD means the position that would be seen by a
26986      *      perfect geodetically aligned theodolite.  (Zenith distance is
26987      *      used rather than altitude in order to reflect the fact that no
26988      *      allowance is made for depression of the horizon.)  This is
26989      *      related to the observed HA,Dec via the standard rotation, using
26990      *      the geodetic latitude (corrected for polar motion), while the
26991      *      observed HA and RA are related simply through the Earth rotation
26992      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
26993      *      means the position that would be seen by a perfect equatorial
26994      *      with its polar axis aligned to the Earth's axis of rotation.
26995      *
26996      *  <li> It is advisable to take great care with units, as even unlikely
26997      *      values of the input parameters are accepted and processed in
26998      *      accordance with the models used.
26999      *
27000      * </ol>
27001      *  Called:
27002      * <ul>
27003      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed, 2013
27004      *     <li>{@link #jauAtciq} quick ICRS to CIRS
27005      *     <li>{@link #jauAtioq} quick ICRS to observed
27006      *
27007      * </ul>
27008      *@version  2013 October 9
27009      *
27010      *@since JSOFA release 20131202
27011      *
27012      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27013      * @throws JSOFAInternalError an internal error has occured
27014      * @throws JSOFAIllegalParameter 
27015      */
27016     public static ObservedPositionEO jauAtco13(double rc, double dc,
27017             double pr, double pd, double px, double rv,
27018             double utc1, double utc2, double dut1,
27019             double elong, double phi, double hm, double xp, double yp,
27020             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27021     {
27022         Astrom astrom = new Astrom();
27023 
27024 
27025         /* Star-independent astrometry parameters. */
27026         double eo = jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27027                 phpa, tc, rh, wl, astrom);
27028 
27029         /* Transform ICRS to CIRS. */
27030         SphericalCoordinate co = jauAtciq(rc, dc, pr, pd, px, rv, astrom);
27031 
27032         /* Transform CIRS to observed. */
27033         ObservedPosition obs = jauAtioq(co.alpha, co.delta, astrom);
27034 
27035       
27036         return new ObservedPositionEO(obs, eo);
27037         
27038         /* Finished. */
27039 
27040 
27041     }
27042 
27043     /**
27044      *  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
27045      *
27046      *<p>This function is derived from the International Astronomical Union's
27047      *  SOFA (Standards of Fundamental Astronomy) software collection.
27048      *
27049      *<p>Status:  support function.
27050      *
27051      *<!-- Given: -->
27052      *     @param ri double   CIRS geocentric RA,Dec (radians)
27053      *     @param di double   CIRS geocentric RA,Dec (radians) 
27054      *     @param date1   double   TDB as a 2-part...
27055      *     @param date2   double   ...Julian Date (Note 1)
27056      *
27057      *<!-- Returned:-->
27058      *     @return rc,dc   double    <b>Returned</b> ICRS astrometric RA,Dec (radians)
27059      *      eo      double    <b>Returned</b> equation of the origins (ERA-GST, Note 4)
27060      *
27061      *<p>Notes:
27062      * <ol>
27063      *
27064      *  <li> The TDB date date1+date2 is a Julian Date, apportioned in any
27065      *     convenient way between the two arguments.  For example,
27066      *     JD(TDB)=2450123.7 could be expressed in any of these ways, among
27067      *     others:
27068      *
27069      *            date1          date2
27070      *
27071      *         2450123.7           0.0       (JD method)
27072      *         2451545.0       -1421.3       (J2000 method)
27073      *         2400000.5       50123.2       (MJD method)
27074      *         2450123.5           0.2       (date &amp; time method)
27075      *
27076      *     <p>The JD method is the most natural and convenient to use in cases
27077      *     where the loss of several decimal digits of resolution is
27078      *     acceptable.  The J2000 method is best matched to the way the
27079      *     argument is handled internally and will deliver the optimum
27080      *     resolution.  The MJD method and the date &amp; time methods are both
27081      *     good compromises between resolution and convenience.  For most
27082      *     applications of this function the choice will not be at all
27083      *     critical.
27084      *
27085      *     <p>TT can be used instead of TDB without any significant impact on
27086      *     accuracy.
27087      *
27088      *  <li> Iterative techniques are used for the aberration and light
27089      *     deflection corrections so that the functions iauAtic13 (or
27090      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27091      *     even at the edge of the Sun's disk the discrepancy is only about
27092      *     1 nanoarcsecond.
27093      *
27094      *  <li> The available accuracy is better than 1 milliarcsecond, limited
27095      *     mainly by the precession-nutation model that is used, namely
27096      *     IAU 2000A/2006.  Very close to solar system bodies, additional
27097      *     errors of up to several milliarcseconds can occur because of
27098      *     unmodeled light deflection;  however, the Sun's contribution is
27099      *     taken into account, to first order.  The accuracy limitations of
27100      *     the SOFA function iauEpv00 (used to compute Earth position and
27101      *     velocity) can contribute aberration errors of up to
27102      *     5 microarcseconds.  Light deflection at the Sun's limb is
27103      *     uncertain at the 0.4 mas level.
27104      *
27105      *  <li> Should the transformation to (equinox based) J2000.0 mean place
27106      *     be required rather than (CIO based) ICRS coordinates, subtract the
27107      *     equation of the origins from the returned right ascension:
27108      *     RA = RI - EO.  (The iauAnp function can then be applied, as
27109      *     required, to keep the result in the conventional 0-2pi range.)
27110      *
27111      * </ol>
27112      *  Called:
27113      * <ul>
27114      *     <li>{@link #jauApci13} astrometry parameters, ICRS-CIRS, 2013
27115      *     <li>{@link #jauAticq} quick CIRS to ICRS astrometric
27116      *
27117      * </ul>
27118      *@version  2013 October 9
27119      *
27120      *@since JSOFA release 20131202
27121      *
27122      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27123      */
27124     public static SphericalCoordinateEO jauAtic13(double ri, double di, double date1, double date2)
27125     {
27126         /* Star-independent astrometry parameters */
27127         Astrom astrom = new Astrom();
27128 
27129 
27130         /* Star-independent astrometry parameters. */
27131         double eo = jauApci13(date1, date2, astrom);
27132 
27133         /* CIRS to ICRS astrometric. */
27134         SphericalCoordinate co = jauAticq(ri, di, astrom);
27135 
27136         return new SphericalCoordinateEO(co,eo);
27137         /* Finished. */
27138 
27139 
27140     }
27141 
27142     /**
27143      *  Quick CIRS RA,Dec to ICRS astrometric place, given the star-
27144      *  independent astrometry parameters.
27145      *
27146      *  Use of this function is appropriate when efficiency is important and
27147      *  where many star positions are all to be transformed for one date.
27148      *  The star-independent astrometry parameters can be obtained by
27149      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27150      *  or iauApcs[13].
27151      *
27152      *<p>This function is derived from the International Astronomical Union's
27153      *  SOFA (Standards of Fundamental Astronomy) software collection.
27154      *
27155      *<p>Status:  support function.
27156      *
27157      *<!-- Given: -->
27158      *     @param ri double      CIRS RA,Dec (radians)
27159      *     @param di double      CIRS RA,Dec (radians) 
27160      *     @param astrom    star-independent astrometry parameters:
27161      *
27162      *<!-- Returned:-->
27163      *     @return rc,dc   double       <b>Returned</b> ICRS astrometric RA,Dec (radians)
27164      *
27165      *<p>Notes:
27166      * <ol>
27167      *
27168      *  <li> Only the Sun is taken into account in the light deflection
27169      *     correction.
27170      *
27171      *  <li> Iterative techniques are used for the aberration and light
27172      *     deflection corrections so that the functions iauAtic13 (or
27173      *     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
27174      *     even at the edge of the Sun's disk the discrepancy is only about
27175      *     1 nanoarcsecond.
27176      *
27177      * </ol>
27178      *  Called:
27179      * <ul>
27180      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27181      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27182      *     <li>{@link #jauZp} zero p-vector
27183      *     <li>{@link #jauAb} stellar aberration
27184      *     <li>{@link #jauLdsun} light deflection by the Sun
27185      *     <li>{@link #jauC2s} p-vector to spherical
27186      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27187      *
27188      * </ul>
27189      *@version  2013 October 9
27190      *
27191      *@since JSOFA release 20131202
27192      *
27193      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27194      */
27195     public static SphericalCoordinate  jauAticq(double ri, double di, Astrom astrom )
27196     {
27197         int j, i;
27198         double pi[] , ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], 
27199                 before[] = new double[3], r2, r,
27200                 after[];
27201 
27202 
27203         /* CIRS RA,Dec to Cartesian. */
27204         pi = jauS2c(ri, di);
27205 
27206         /* Bias-precession-nutation, giving GCRS proper direction. */
27207         ppr = jauTrxp(astrom.bpn, pi);
27208 
27209         /* Aberration, giving GCRS natural direction. */
27210         jauZp(d);
27211         for (j = 0; j < 2; j++) {
27212             r2 = 0.0;
27213             for (i = 0; i < 3; i++) {
27214                 w = ppr[i] - d[i];
27215                 before[i] = w;
27216                 r2 += w*w;
27217             }
27218             r = sqrt(r2);
27219             for (i = 0; i < 3; i++) {
27220                 before[i] /= r;
27221             }
27222             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27223             r2 = 0.0;
27224             for (i = 0; i < 3; i++) {
27225                 d[i] = after[i] - before[i];
27226                 w = ppr[i] - d[i];
27227                 pnat[i] = w;
27228                 r2 += w*w;
27229             }
27230             r = sqrt(r2);
27231             for (i = 0; i < 3; i++) {
27232                 pnat[i] /= r;
27233             }
27234         }
27235 
27236         /* Light deflection by the Sun, giving BCRS coordinate direction. */
27237         jauZp(d);
27238         for (j = 0; j < 5; j++) {
27239             r2 = 0.0;
27240             for (i = 0; i < 3; i++) {
27241                 w = pnat[i] - d[i];
27242                 before[i] = w;
27243                 r2 += w*w;
27244             }
27245             r = sqrt(r2);
27246             for (i = 0; i < 3; i++) {
27247                 before[i] /= r;
27248             }
27249             after = jauLdsun(before, astrom.eh, astrom.em);
27250             r2 = 0.0;
27251             for (i = 0; i < 3; i++) {
27252                 d[i] = after[i] - before[i];
27253                 w = pnat[i] - d[i];
27254                 pco[i] = w;
27255                 r2 += w*w;
27256             }
27257             r = sqrt(r2);
27258             for (i = 0; i < 3; i++) {
27259                 pco[i] /= r;
27260             }
27261         }
27262 
27263         /* ICRS astrometric RA,Dec. */
27264         SphericalCoordinate co = jauC2s(pco);
27265         co.alpha = jauAnp(co.alpha);
27266 
27267         return co;
27268         /* Finished. */
27269 
27270 
27271     }
27272 
27273     /**
27274      *  Quick CIRS to ICRS astrometric place transformation, given the star-
27275      *  independent astrometry parameters plus a list of light-deflecting
27276      *  bodies.
27277      *
27278      *  Use of this function is appropriate when efficiency is important and
27279      *  where many star positions are all to be transformed for one date.
27280      *  The star-independent astrometry parameters can be obtained by
27281      *  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
27282      *  or iauApcs[13].
27283      *
27284      *  If the only light-deflecting body to be taken into account is the
27285      *  Sun, the iauAticq function can be used instead.
27286      *
27287      *<p>This function is derived from the International Astronomical Union's
27288      *  SOFA (Standards of Fundamental Astronomy) software collection.
27289      *
27290      *<p>Status:  support function.
27291      *
27292      *<!-- Given: -->
27293      *     @param ri double       CIRS RA,Dec (radians)
27294      *     @param di double       CIRS RA,Dec (radians) 
27295      *     @param astrom     star-independent astrometry parameters:
27296      *     @param n number of bodies.
27297      *     @param b[] data for each of the n bodies.
27298      *
27299      *<!-- Returned:-->
27300      *     @return        ICRS astrometric RA,Dec (radians)
27301      *
27302      *<p>Notes:
27303      * <ol>
27304      *
27305      *  <li> Iterative techniques are used for the aberration and light
27306      *     deflection corrections so that the functions iauAticqn and
27307      *     iauAtciqn are accurate inverses; even at the edge of the Sun's
27308      *     disk the discrepancy is only about 1 nanoarcsecond.
27309      *
27310      *  <li> If the only light-deflecting body to be taken into account is the
27311      *     Sun, the iauAticq function can be used instead.
27312      *
27313      *  <li> The struct b contains n entries, one for each body to be
27314      *     considered.  If n = 0, no gravitational light deflection will be
27315      *     applied, not even for the Sun.
27316      *
27317      *  <li> The struct b should include an entry for the Sun as well as for
27318      *     any planet or other body to be taken into account.  The entries
27319      *     should be in the order in which the light passes the body.
27320      *
27321      *  <li> In the entry in the b struct for body i, the mass parameter
27322      *     b[i].bm can, as required, be adjusted in order to allow for such
27323      *     effects as quadrupole field.
27324      *
27325      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
27326      *     the angular separation (in radians) between star and body at
27327      *     which limiting is applied.  As phi shrinks below the chosen
27328      *     threshold, the deflection is artificially reduced, reaching zero
27329      *     for phi = 0.   Example values suitable for a terrestrial
27330      *     observer, together with masses, are as follows:
27331      *
27332      *        <p>body i     b[i].bm        b[i].dl
27333      *
27334      *        <p>Sun        1.0            6e-6
27335      *        Jupiter    0.00095435     3e-9
27336      *        Saturn     0.00028574     3e-10
27337      *
27338      *  <li> For efficiency, validation of the contents of the b array is
27339      *     omitted.  The supplied masses must be greater than zero, the
27340      *     position and velocity vectors must be right, and the deflection
27341      *     limiter greater than zero.
27342      *
27343      * </ol>
27344      *  Called:
27345      * <ul>
27346      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27347      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
27348      *     <li>{@link #jauZp} zero p-vector
27349      *     <li>{@link #jauAb} stellar aberration
27350      *     <li>{@link #jauLdn} light deflection by n bodies
27351      *     <li>{@link #jauC2s} p-vector to spherical
27352      *     <li>{@link #jauAnp} normalize angle into range +/- pi
27353      *
27354      * </ul>
27355      *@version  2013 October 9
27356      *
27357      *@since JSOFA release 20131202
27358      *
27359      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27360      */
27361     public static SphericalCoordinate jauAticqn(double ri, double di, Astrom astrom,
27362             int n, Ldbody b[])
27363     {
27364         int j, i;
27365         double pi[], ppr[], pnat[] = new double[3], pco[] = new double[3], w, d[] = new double[3], before[] = new double[3], r2, r,
27366                 after[];
27367 
27368 
27369         /* CIRS RA,Dec to Cartesian. */
27370         pi = jauS2c(ri, di);
27371 
27372         /* Bias-precession-nutation, giving GCRS proper direction. */
27373         ppr = jauTrxp(astrom.bpn, pi);
27374 
27375         /* Aberration, giving GCRS natural direction. */
27376         jauZp(d);
27377         for (j = 0; j < 2; j++) {
27378             r2 = 0.0;
27379             for (i = 0; i < 3; i++) {
27380                 w = ppr[i] - d[i];
27381                 before[i] = w;
27382                 r2 += w*w;
27383             }
27384             r = sqrt(r2);
27385             for (i = 0; i < 3; i++) {
27386                 before[i] /= r;
27387             }
27388             after = jauAb(before, astrom.v, astrom.em, astrom.bm1);
27389             r2 = 0.0;
27390             for (i = 0; i < 3; i++) {
27391                 d[i] = after[i] - before[i];
27392                 w = ppr[i] - d[i];
27393                 pnat[i] = w;
27394                 r2 += w*w;
27395             }
27396             r = sqrt(r2);
27397             for (i = 0; i < 3; i++) {
27398                 pnat[i] /= r;
27399             }
27400         }
27401 
27402         /* Light deflection, giving BCRS coordinate direction. */
27403         jauZp(d);
27404         for (j = 0; j < 5; j++) {
27405             r2 = 0.0;
27406             for (i = 0; i < 3; i++) {
27407                 w = pnat[i] - d[i];
27408                 before[i] = w;
27409                 r2 += w*w;
27410             }
27411             r = sqrt(r2);
27412             for (i = 0; i < 3; i++) {
27413                 before[i] /= r;
27414             }
27415             after = jauLdn(n, b, astrom.eb, before);
27416             r2 = 0.0;
27417             for (i = 0; i < 3; i++) {
27418                 d[i] = after[i] - before[i];
27419                 w = pnat[i] - d[i];
27420                 pco[i] = w;
27421                 r2 += w*w;
27422             }
27423             r = sqrt(r2);
27424             for (i = 0; i < 3; i++) {
27425                 pco[i] /= r;
27426             }
27427         }
27428 
27429         /* ICRS astrometric RA,Dec. */
27430         SphericalCoordinate co = jauC2s(pco);
27431         co.alpha = jauAnp(co.alpha);
27432 
27433         return co;
27434         /* Finished. */
27435 
27436 
27437     }
27438     
27439     /**
27440      * Observed Position.
27441      *  "Observed" Az,ZD means the position that would be seen by a
27442      *      perfect geodetically aligned theodolite.  (Zenith distance is
27443      *      used rather than altitude in order to reflect the fact that no
27444      *      allowance is made for depression of the horizon.)  This is
27445      *      related to the observed HA,Dec via the standard rotation, using
27446      *      the geodetic latitude (corrected for polar motion), while the
27447      *      observed HA and RA are related simply through the Earth rotation
27448      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27449      *      means the position that would be seen by a perfect equatorial
27450      *      with its polar axis aligned to the Earth's axis of rotation..
27451      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
27452      * @version $Revision$ $date$
27453      */
27454     public static class ObservedPosition{
27455         /**    observed azimuth (radians: N=0,E=90) */
27456         public double   aob;
27457 
27458         /**    observed zenith distance (radians)   */
27459         public double   zob;
27460 
27461         /**    observed Hour Angle (radians)        */
27462         public double   hob;
27463 
27464         /**    observed Declination (radians)       */
27465         public double   dob;
27466 
27467         /**    observed Right Ascension (radians)   */
27468         public double   rob;
27469         public ObservedPosition(double   aob,
27470                 double   zob,
27471                 double   hob,
27472                 double   dob,
27473                 double   rob
27474         ) {
27475             this.aob =  aob;
27476             this.zob =  zob;
27477             this.hob =  hob;
27478             this.dob =  dob;
27479             this.rob =  rob;  
27480         }
27481     }
27482     
27483     /**
27484      * Observed position with the equation of the origins.
27485      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 29 Mar 2014
27486      * @version $Revision$ $date$
27487      */
27488     public static class ObservedPositionEO {
27489        /**
27490         * observed position.
27491         */
27492         public ObservedPosition op;
27493         /**
27494          * The equation of the origins.    The equation of the origins is the distance between the true
27495          *  equinox and the celestial intermediate origin and, equivalently,
27496          *  the difference between Earth rotation angle and Greenwich
27497          *  apparent sidereal time (ERA-GST).  It comprises the precession
27498          *  (since J2000.0) in right ascension plus the equation of the
27499          *  equinoxes (including the small correction terms).   
27500          */
27501         public double eo;
27502         /**
27503          * @param op
27504          * @param eo
27505          */
27506         public ObservedPositionEO(ObservedPosition op, double eo) {
27507             this.op = op;
27508             this.eo = eo;
27509         }
27510         
27511     }
27512 
27513     
27514     
27515     
27516     /**
27517      *  CIRS RA,Dec to observed place.  The caller supplies UTC, site
27518      *  coordinates, ambient air conditions and observing wavelength.
27519      *
27520      *<p>This function is derived from the International Astronomical Union's
27521      *  SOFA (Standards of Fundamental Astronomy) software collection.
27522      *
27523      *<p>Status:  support function.
27524      *
27525      *<!-- Given: -->
27526      *     @param ri      double    CIRS right ascension (CIO-based, radians)
27527      *     @param di      double    CIRS declination (radians)
27528      *     @param utc1    double    UTC as a 2-part...
27529      *     @param utc2    double    ...quasi Julian Date (Notes 1,2)
27530      *     @param dut1    double    UT1-UTC (seconds, Note 3)
27531      *     @param elong   double    longitude (radians, east +ve, Note 4)
27532      *     @param phi     double    geodetic latitude (radians, Note 4)
27533      *     @param hm      double    height above ellipsoid (m, geodetic Notes 4,6)
27534      *     @param xp double    polar motion coordinates (radians, Note 5)
27535      *     @param yp double    polar motion coordinates (radians, Note 5) 
27536      *     @param phpa    double    pressure at the observer (hPa = mB, Note 6)
27537      *     @param tc      double    ambient temperature at the observer (deg C)
27538      *     @param rh      double    relative humidity at the observer (range 0-1)
27539      *     @param wl      double    wavelength (micrometers, Note 7)
27540      *
27541      *<!-- Returned:-->
27542      *     @return aob     double*    <b>Returned</b> observed azimuth (radians: N=0,E=90)
27543      *             zob     double*    <b>Returned</b> observed zenith distance (radians)
27544      *             hob     double*    <b>Returned</b> observed hour angle (radians)
27545      *             dob     double*    <b>Returned</b> observed declination (radians)
27546      *             rob     double*    <b>Returned</b> observed right ascension (CIO-based, radians)
27547      *
27548      *  @throws JSOFAInternalError an internal error has occured
27549      *  @throws JSOFAIllegalParameter
27550      *             int       status:   <b>Returned</b> +1 = dubious year (Note 2)
27551      *                              0  =   <b>Returned</b> OK
27552      *                              -1  =   <b>Returned</b> unacceptable date
27553      *
27554      *<p>Notes:
27555      * <ol>
27556      *
27557      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27558      *      convenient way between the two arguments, for example where utc1
27559      *      is the Julian Day Number and utc2 is the fraction of a day.
27560      *
27561      *      <p>However, JD cannot unambiguously represent UTC during a leap
27562      *      second unless special measures are taken.  The convention in the
27563      *      present function is that the JD day represents UTC days whether
27564      *      the length is 86399, 86400 or 86401 SI seconds.
27565      *
27566      *      <p>Applications should use the function iauDtf2d to convert from
27567      *      calendar date and time of day into 2-part quasi Julian Date, as
27568      *      it implements the leap-second-ambiguity convention just
27569      *      described.
27570      *
27571      *  <li> The warning status "dubious year" flags UTCs that predate the
27572      *      introduction of the time scale or that are too far in the
27573      *      future to be trusted.  See iauDat for further details.
27574      *
27575      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27576      *      one second at the end of each positive UTC leap second,
27577      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27578      *      practice is under review, and in the future UT1-UTC may grow
27579      *      essentially without limit.
27580      *
27581      *  <li> The geographical coordinates are with respect to the WGS84
27582      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27583      *      longitude required by the present function is east-positive
27584      *      (i.e. right-handed), in accordance with geographical convention.
27585      *
27586      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27587      *      values are the coordinates (in radians) of the Celestial
27588      *      Intermediate Pole with respect to the International Terrestrial
27589      *      Reference System (see IERS Conventions 2003), measured along the
27590      *      meridians 0 and 90 deg west respectively.  For many
27591      *      applications, xp and yp can be set to zero.
27592      *
27593      *  <li> If hm, the height above the ellipsoid of the observing station
27594      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
27595      *      available, an adequate estimate of hm can be obtained from the
27596      *      expression
27597      *
27598      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27599      *
27600      *      <p>where tsl is the approximate sea-level air temperature in K
27601      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27602      *      52).  Similarly, if the pressure phpa is not known, it can be
27603      *      estimated from the height of the observing station, hm, as
27604      *      follows:
27605      *
27606      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27607      *
27608      *      <p>Note, however, that the refraction is nearly proportional to
27609      *      the pressure and that an accurate phpa value is important for
27610      *      precise work.
27611      *
27612      *  <li> The argument wl specifies the observing wavelength in
27613      *      micrometers.  The transition from optical to radio is assumed to
27614      *      occur at 100 micrometers (about 3000 GHz).
27615      *
27616      *  <li> "Observed" Az,ZD means the position that would be seen by a
27617      *      perfect geodetically aligned theodolite.  (Zenith distance is
27618      *      used rather than altitude in order to reflect the fact that no
27619      *      allowance is made for depression of the horizon.)  This is
27620      *      related to the observed HA,Dec via the standard rotation, using
27621      *      the geodetic latitude (corrected for polar motion), while the
27622      *      observed HA and RA are related simply through the Earth rotation
27623      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27624      *      means the position that would be seen by a perfect equatorial
27625      *      with its polar axis aligned to the Earth's axis of rotation.
27626      *
27627      *  <li> The accuracy of the result is limited by the corrections for
27628      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27629      *      Providing the meteorological parameters are known accurately and
27630      *      there are no gross local effects, the predicted astrometric
27631      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27632      *      (radio) for a zenith distance of less than 70 degrees, better
27633      *      than 30 arcsec (optical or radio) at 85 degrees and better
27634      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27635      *
27636      *  <li> The complementary functions iauAtio13 and iauAtoi13 are self-
27637      *      consistent to better than 1 microarcsecond all over the
27638      *      celestial sphere.
27639      *
27640      *  <li> It is advisable to take great care with units, as even unlikely
27641      *      values of the input parameters are accepted and processed in
27642      *      accordance with the models used.
27643      *
27644      * </ol>
27645      *  Called:
27646      * <ul>
27647      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
27648      *     <li>{@link #jauAtioq} quick CIRS to observed
27649      *
27650      * </ul>
27651      *@version  2013 October 9
27652      *
27653      *@since JSOFA release 20131202
27654      *
27655      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27656      * @throws JSOFAInternalError an internal error has occured
27657      * @throws JSOFAIllegalParameter 
27658      */
27659     public static ObservedPosition jauAtio13(double ri, double di,
27660             double utc1, double utc2, double dut1,
27661             double elong, double phi, double hm, double xp, double yp,
27662             double phpa, double tc, double rh, double wl) throws JSOFAIllegalParameter, JSOFAInternalError
27663     {
27664         Astrom astrom = new Astrom();
27665 
27666 
27667         /* Star-independent astrometry parameters for CIRS->observed. */
27668         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
27669                 phpa, tc, rh, wl, astrom);
27670 
27671         /* Transform CIRS to observed. */
27672         return jauAtioq(ri, di, astrom);
27673 
27674         /* Finished. */
27675 
27676 
27677     }
27678 
27679     /**
27680      *  Quick CIRS to observed place transformation.
27681      *
27682      *  Use of this function is appropriate when efficiency is important and
27683      *  where many star positions are all to be transformed for one date.
27684      *  The star-independent astrometry parameters can be obtained by
27685      *  calling iauApio[13] or iauApco[13].
27686      *
27687      *<p>This function is derived from the International Astronomical Union's
27688      *  SOFA (Standards of Fundamental Astronomy) software collection.
27689      *
27690      *<p>Status:  support function.
27691      *
27692      *<!-- Given: -->
27693      *     @param ri      double      CIRS right ascension
27694      *     @param di      double      CIRS declination
27695      *     @param astrom    star-independent astrometry parameters:
27696      *
27697      *<!-- Returned:-->
27698      *     @return aob     double*      <b>Returned</b> observed azimuth (radians: N=0,E=90)
27699      *             zob     double*      <b>Returned</b> observed zenith distance (radians)
27700      *             hob     double*      <b>Returned</b> observed hour angle (radians)
27701      *             dob     double*      <b>Returned</b> observed declination (radians)
27702      *             rob     double*      <b>Returned</b> observed right ascension (CIO-based, radians)
27703      *
27704      *<p>Notes:
27705      * <ol>
27706      *
27707      *  <li> This function returns zenith distance rather than altitude in
27708      *     order to reflect the fact that no allowance is made for
27709      *     depression of the horizon.
27710      *
27711      *  <li> The accuracy of the result is limited by the corrections for
27712      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27713      *     Providing the meteorological parameters are known accurately and
27714      *     there are no gross local effects, the predicted observed
27715      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27716      *     (radio) for a zenith distance of less than 70 degrees, better
27717      *     than 30 arcsec (optical or radio) at 85 degrees and better
27718      *     than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27719      *
27720      *     <p>Without refraction, the complementary functions iauAtioq and
27721      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
27722      *     over the celestial sphere.  With refraction included, consistency
27723      *     falls off at high zenith distances, but is still better than
27724      *     0.05 arcsec at 85 degrees.
27725      *
27726      *  <li> It is advisable to take great care with units, as even unlikely
27727      *     values of the input parameters are accepted and processed in
27728      *     accordance with the models used.
27729      *
27730      *  <li> The CIRS RA,Dec is obtained from a star catalog mean place by
27731      *     allowing for space motion, parallax, the Sun's gravitational lens
27732      *     effect, annual aberration and precession-nutation.  For star
27733      *     positions in the ICRS, these effects can be applied by means of
27734      *     the iauAtci13 (etc.) functions.  Starting from classical "mean
27735      *     place" systems, additional transformations will be needed first.
27736      *
27737      *  <li> "Observed" Az,El means the position that would be seen by a
27738      *     perfect geodetically aligned theodolite.  This is obtained from
27739      *     the CIRS RA,Dec by allowing for Earth orientation and diurnal
27740      *     aberration, rotating from equator to horizon coordinates, and
27741      *     then adjusting for refraction.  The HA,Dec is obtained by
27742      *     rotating back into equatorial coordinates, and is the position
27743      *     that would be seen by a perfect equatorial with its polar axis
27744      *     aligned to the Earth's axis of rotation.  Finally, the RA is
27745      *     obtained by subtracting the HA from the local ERA.
27746      *
27747      *  <li> The star-independent CIRS-to-observed-place parameters in ASTROM
27748      *     may be computed with iauApio[13] or iauApco[13].  If nothing has
27749      *     changed significantly except the time, iauAper[13] may be used to
27750      *     perform the requisite adjustment to the astrom structure.
27751      *
27752      * </ol>
27753      *  Called:
27754      * <ul>
27755      *     <li>{@link #jauS2c} spherical coordinates to unit vector
27756      *     <li>{@link #jauC2s} p-vector to spherical
27757      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
27758      *
27759      * </ul>
27760      *@version  2013 December 5
27761      *
27762      *@since JSOFA release 20131202
27763      *
27764      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
27765      */
27766     public static ObservedPosition jauAtioq(double ri, double di, Astrom astrom)
27767     {
27768         /* Minimum cos(alt) and sin(alt) for refraction purposes */
27769         final double CELMIN = 1e-6;
27770         final double SELMIN = 0.05;
27771 
27772         double v[] = new double[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt,
27773                 xaet, yaet, zaet, azobs, r, tz, w, del, cosdel,
27774                 xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
27775 
27776         /*--------------------------------------------------------------------*/
27777 
27778         /* CIRS RA,Dec to Cartesian -HA,Dec. */
27779         v = jauS2c(ri-astrom.eral, di);
27780         x = v[0];
27781         y = v[1];
27782         z = v[2];
27783 
27784         /* Polar motion. */
27785         xhd = x + astrom.xpl*z;
27786         yhd = y - astrom.ypl*z;
27787         zhd = z - astrom.xpl*x + astrom.ypl*y;
27788 
27789         /* Diurnal aberration. */
27790         f = ( 1.0 - astrom.diurab*yhd );
27791         xhdt = f * xhd;
27792         yhdt = f * ( yhd + astrom.diurab );
27793         zhdt = f * zhd;
27794 
27795         /* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
27796         xaet = astrom.sphi*xhdt - astrom.cphi*zhdt;
27797         yaet = yhdt;
27798         zaet = astrom.cphi*xhdt + astrom.sphi*zhdt;
27799 
27800         /* Azimuth (N=0,E=90). */
27801         azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
27802 
27803         /* ---------- */
27804         /* Refraction */
27805         /* ---------- */
27806 
27807         /* Cosine and sine of altitude, with precautions. */
27808         r = sqrt(xaet*xaet + yaet*yaet);
27809         r = r > CELMIN ? r : CELMIN;
27810         z = zaet > SELMIN ? zaet : SELMIN;
27811 
27812         /* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
27813         tz = r/z;
27814         w = astrom.refb*tz*tz;
27815         del = ( astrom.refa + w ) * tz /
27816                 ( 1.0 + ( astrom.refa + 3.0*w ) / ( z*z ) );
27817 
27818         /* Apply the change, giving observed vector. */
27819         cosdel = 1.0 - del*del/2.0;
27820         f = cosdel - del*z/r;
27821         xaeo = xaet*f;
27822         yaeo = yaet*f;
27823         zaeo = cosdel*zaet + del*r;
27824 
27825         /* Observed ZD. */
27826         zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
27827 
27828         /* Az/El vector to HA,Dec vector (both right-handed). */
27829         v[0] = astrom.sphi*xaeo + astrom.cphi*zaeo;
27830         v[1] = yaeo;
27831         v[2] = - astrom.cphi*xaeo + astrom.sphi*zaeo;
27832 
27833         /* To spherical -HA,Dec. */
27834         SphericalCoordinate co = jauC2s ( v);
27835         hmobs = co.alpha;
27836         dcobs = co.delta;
27837         /* Right ascension (with respect to CIO). */
27838         raobs = astrom.eral + hmobs;
27839 
27840         /* Return the results. */
27841         return new ObservedPosition(
27842         jauAnp(azobs),
27843         zdobs,
27844         -hmobs,
27845         dcobs,
27846         jauAnp(raobs));
27847 
27848         /* Finished. */
27849 
27850 
27851     }
27852 
27853     /**
27854      *  Observed place at a groundbased site to to ICRS astrometric RA,Dec.
27855      *  The caller supplies UTC, site coordinates, ambient air conditions
27856      *  and observing wavelength.
27857      *
27858      *<p>This function is derived from the International Astronomical Union's
27859      *  SOFA (Standards of Fundamental Astronomy) software collection.
27860      *
27861      *<p>Status:  support function.
27862      *
27863      *<!-- Given: -->
27864      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
27865      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
27866      *     @param ob2     double    observed ZD or Dec (radians)
27867      *     @param utc1    double    UTC as a 2-part...
27868      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
27869      *     @param dut1    double    UT1-UTC (seconds, Note 5)
27870      *     @param elong   double    longitude (radians, east +ve, Note 6)
27871      *     @param phi     double    geodetic latitude (radians, Note 6)
27872      *     @param hm      double    height above ellipsoid (m, geodetic Notes 6,8)
27873      *     @param xp double    polar motion coordinates (radians, Note 7)
27874      *     @param yp double    polar motion coordinates (radians, Note 7) 
27875      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
27876      *     @param tc      double    ambient temperature at the observer (deg C)
27877      *     @param rh      double    relative humidity at the observer (range 0-1)
27878      *     @param wl      double    wavelength (micrometers, Note 9)
27879      *
27880      *<!-- Returned:-->
27881      *     @return rc,dc   double     <b>Returned</b> ICRS astrometric RA,Dec (radians)
27882      *
27883      *  @throws JSOFAInternalError an internal error has occured
27884      *  @throws JSOFAIllegalParameter
27885      *                   int       status:   <b>Returned</b> +1 = dubious year (Note 4)
27886      *                               0  =   <b>Returned</b> OK
27887      *                              -1  =   <b>Returned</b> unacceptable date
27888      *
27889      *<p>Notes:
27890      * <ol>
27891      *
27892      *  <li> "Observed" Az,ZD means the position that would be seen by a
27893      *      perfect geodetically aligned theodolite.  (Zenith distance is
27894      *      used rather than altitude in order to reflect the fact that no
27895      *      allowance is made for depression of the horizon.)  This is
27896      *      related to the observed HA,Dec via the standard rotation, using
27897      *      the geodetic latitude (corrected for polar motion), while the
27898      *      observed HA and RA are related simply through the Earth rotation
27899      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
27900      *      means the position that would be seen by a perfect equatorial
27901      *      with its polar axis aligned to the Earth's axis of rotation.
27902      *
27903      *  <li> Only the first character of the type argument is significant.
27904      *      "R" or "r" indicates that ob1 and ob2 are the observed right
27905      *      ascension and declination;  "H" or "h" indicates that they are
27906      *      hour angle (west +ve) and declination;  anything else ("A" or
27907      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
27908      *      (north zero, east 90 deg) and zenith distance.
27909      *
27910      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
27911      *      convenient way between the two arguments, for example where utc1
27912      *      is the Julian Day Number and utc2 is the fraction of a day.
27913      *
27914      *      <p>However, JD cannot unambiguously represent UTC during a leap
27915      *      second unless special measures are taken.  The convention in the
27916      *      present function is that the JD day represents UTC days whether
27917      *      the length is 86399, 86400 or 86401 SI seconds.
27918      *
27919      *      <p>Applications should use the function iauDtf2d to convert from
27920      *      calendar date and time of day into 2-part quasi Julian Date, as
27921      *      it implements the leap-second-ambiguity convention just
27922      *      described.
27923      *
27924      *  <li> The warning status "dubious year" flags UTCs that predate the
27925      *      introduction of the time scale or that are too far in the
27926      *      future to be trusted.  See iauDat for further details.
27927      *
27928      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
27929      *      one second at the end of each positive UTC leap second,
27930      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
27931      *      practice is under review, and in the future UT1-UTC may grow
27932      *      essentially without limit.
27933      *
27934      *  <li> The geographical coordinates are with respect to the WGS84
27935      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
27936      *      longitude required by the present function is east-positive
27937      *      (i.e. right-handed), in accordance with geographical convention.
27938      *
27939      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
27940      *      values are the coordinates (in radians) of the Celestial
27941      *      Intermediate Pole with respect to the International Terrestrial
27942      *      Reference System (see IERS Conventions 2003), measured along the
27943      *      meridians 0 and 90 deg west respectively.  For many
27944      *      applications, xp and yp can be set to zero.
27945      *
27946      *  <li> If hm, the height above the ellipsoid of the observing station
27947      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
27948      *      available, an adequate estimate of hm can be obtained from the
27949      *      expression
27950      *
27951      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
27952      *
27953      *      <p>where tsl is the approximate sea-level air temperature in K
27954      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
27955      *      52).  Similarly, if the pressure phpa is not known, it can be
27956      *      estimated from the height of the observing station, hm, as
27957      *      follows:
27958      *
27959      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
27960      *
27961      *      <p>Note, however, that the refraction is nearly proportional to
27962      *      the pressure and that an accurate phpa value is important for
27963      *      precise work.
27964      *
27965      *  <li> The argument wl specifies the observing wavelength in
27966      *      micrometers.  The transition from optical to radio is assumed to
27967      *      occur at 100 micrometers (about 3000 GHz).
27968      *
27969      *  <li> The accuracy of the result is limited by the corrections for
27970      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
27971      *      Providing the meteorological parameters are known accurately and
27972      *      there are no gross local effects, the predicted astrometric
27973      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
27974      *      (radio) for a zenith distance of less than 70 degrees, better
27975      *      than 30 arcsec (optical or radio) at 85 degrees and better
27976      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
27977      *
27978      *      <p>Without refraction, the complementary functions iauAtco13 and
27979      *      iauAtoc13 are self-consistent to better than 1 microarcsecond
27980      *      all over the celestial sphere.  With refraction included,
27981      *      consistency falls off at high zenith distances, but is still
27982      *      better than 0.05 arcsec at 85 degrees.
27983      *
27984      *  <li> It is advisable to take great care with units, as even unlikely
27985      *      values of the input parameters are accepted and processed in
27986      *      accordance with the models used.
27987      *
27988      * </ol>
27989      *  Called:
27990      * <ul>
27991      *     <li>{@link #jauApco13} astrometry parameters, ICRS-observed
27992      *     <li>{@link #jauAtoiq} quick observed to CIRS
27993      *     <li>{@link #jauAticq} quick CIRS to ICRS
27994      *
27995      * </ul>
27996      *@version  2013 October 9
27997      *
27998      *@since JSOFA release 20131202
27999      *
28000      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28001      * @throws JSOFAInternalError an internal error has occured
28002      * @throws JSOFAIllegalParameter 
28003      */
28004     public static SphericalCoordinate jauAtoc13(String type, double ob1, double ob2,
28005             double utc1, double utc2, double dut1,
28006             double elong, double phi, double hm, double xp, double yp,
28007             double phpa, double tc, double rh, double wl
28008             ) throws JSOFAIllegalParameter, JSOFAInternalError
28009     {
28010         Astrom astrom = new Astrom();
28011         jauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28012                 phpa, tc, rh, wl, astrom);
28013 
28014         /* Transform observed to CIRS. */
28015         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28016 
28017         /* Transform CIRS to ICRS. */
28018         SphericalCoordinate icrs = jauAticq(co.alpha, co.delta, astrom);
28019         return icrs;
28020        
28021 
28022         /* Finished. */
28023 
28024 
28025     }
28026 
28027     /**
28028      *  Observed place to CIRS.  The caller supplies UTC, site coordinates,
28029      *  ambient air conditions and observing wavelength.
28030      *
28031      *<p>This function is derived from the International Astronomical Union's
28032      *  SOFA (Standards of Fundamental Astronomy) software collection.
28033      *
28034      *<p>Status:  support function.
28035      *
28036      *<!-- Given: -->
28037      *     @param type    char[]    type of coordinates - "R", "H" or "A" (Notes 1,2)
28038      *     @param ob1     double    observed Az, HA or RA (radians; Az is N=0,E=90)
28039      *     @param ob2     double    observed ZD or Dec (radians)
28040      *     @param utc1    double    UTC as a 2-part...
28041      *     @param utc2    double    ...quasi Julian Date (Notes 3,4)
28042      *     @param dut1    double    UT1-UTC (seconds, Note 5)
28043      *     @param elong   double    longitude (radians, east +ve, Note 6)
28044      *     @param phi     double    geodetic latitude (radians, Note 6)
28045      *     @param hm      double    height above the ellipsoid (meters, Notes 6,8)
28046      *     @param xp double    polar motion coordinates (radians, Note 7)
28047      *     @param yp double    polar motion coordinates (radians, Note 7) 
28048      *     @param phpa    double    pressure at the observer (hPa = mB, Note 8)
28049      *     @param tc      double    ambient temperature at the observer (deg C)
28050      *     @param rh      double    relative humidity at the observer (range 0-1)
28051      *     @param wl      double    wavelength (micrometers, Note 9)
28052      *
28053      *<!-- Returned:-->
28054      *     @return ri      double*    <b>Returned</b> CIRS right ascension (CIO-based, radians)
28055      *             di      double*    <b>Returned</b> CIRS declination (radians)
28056      *
28057      *  @throws JSOFAInternalError an internal error has occured
28058      *  @throws JSOFAIllegalParameter
28059      *             int       status:   <b>Returned</b> +1 = dubious year (Note 2)
28060      *                               0  =   <b>Returned</b> OK
28061      *                              -1  =   <b>Returned</b> unacceptable date
28062      *
28063      *<p>Notes:
28064      * <ol>
28065      *
28066      *  <li> "Observed" Az,ZD means the position that would be seen by a
28067      *      perfect geodetically aligned theodolite.  (Zenith distance is
28068      *      used rather than altitude in order to reflect the fact that no
28069      *      allowance is made for depression of the horizon.)  This is
28070      *      related to the observed HA,Dec via the standard rotation, using
28071      *      the geodetic latitude (corrected for polar motion), while the
28072      *      observed HA and RA are related simply through the Earth rotation
28073      *      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
28074      *      means the position that would be seen by a perfect equatorial
28075      *      with its polar axis aligned to the Earth's axis of rotation.
28076      *
28077      *  <li> Only the first character of the type argument is significant.
28078      *      "R" or "r" indicates that ob1 and ob2 are the observed right
28079      *      ascension and declination;  "H" or "h" indicates that they are
28080      *      hour angle (west +ve) and declination;  anything else ("A" or
28081      *      "a" is recommended) indicates that ob1 and ob2 are azimuth
28082      *      (north zero, east 90 deg) and zenith distance.
28083      *
28084      *  <li> utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
28085      *      convenient way between the two arguments, for example where utc1
28086      *      is the Julian Day Number and utc2 is the fraction of a day.
28087      *
28088      *      <p>However, JD cannot unambiguously represent UTC during a leap
28089      *      second unless special measures are taken.  The convention in the
28090      *      present function is that the JD day represents UTC days whether
28091      *      the length is 86399, 86400 or 86401 SI seconds.
28092      *
28093      *      <p>Applications should use the function iauDtf2d to convert from
28094      *      calendar date and time of day into 2-part quasi Julian Date, as
28095      *      it implements the leap-second-ambiguity convention just
28096      *      described.
28097      *
28098      *  <li> The warning status "dubious year" flags UTCs that predate the
28099      *      introduction of the time scale or that are too far in the
28100      *      future to be trusted.  See iauDat for further details.
28101      *
28102      *  <li> UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
28103      *      one second at the end of each positive UTC leap second,
28104      *      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
28105      *      practice is under review, and in the future UT1-UTC may grow
28106      *      essentially without limit.
28107      *
28108      *  <li> The geographical coordinates are with respect to the WGS84
28109      *      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
28110      *      longitude required by the present function is east-positive
28111      *      (i.e. right-handed), in accordance with geographical convention.
28112      *
28113      *  <li> The polar motion xp,yp can be obtained from IERS bulletins.  The
28114      *      values are the coordinates (in radians) of the Celestial
28115      *      Intermediate Pole with respect to the International Terrestrial
28116      *      Reference System (see IERS Conventions 2003), measured along the
28117      *      meridians 0 and 90 deg west respectively.  For many
28118      *      applications, xp and yp can be set to zero.
28119      *
28120      *  <li> If hm, the height above the ellipsoid of the observing station
28121      *      in meters, is not known but phpa, the pressure in hPa (=mB), is
28122      *      available, an adequate estimate of hm can be obtained from the
28123      *      expression
28124      *
28125      *            <p>hm = -29.3 * tsl * log ( phpa / 1013.25 );
28126      *
28127      *      <p>where tsl is the approximate sea-level air temperature in K
28128      *      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
28129      *      52).  Similarly, if the pressure phpa is not known, it can be
28130      *      estimated from the height of the observing station, hm, as
28131      *      follows:
28132      *
28133      *            <p>phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
28134      *
28135      *      <p>Note, however, that the refraction is nearly proportional to
28136      *      the pressure and that an accurate phpa value is important for
28137      *      precise work.
28138      *
28139      *  <li> The argument wl specifies the observing wavelength in
28140      *      micrometers.  The transition from optical to radio is assumed to
28141      *      occur at 100 micrometers (about 3000 GHz).
28142      *
28143      *  <li> The accuracy of the result is limited by the corrections for
28144      *      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28145      *      Providing the meteorological parameters are known accurately and
28146      *      there are no gross local effects, the predicted astrometric
28147      *      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28148      *      (radio) for a zenith distance of less than 70 degrees, better
28149      *      than 30 arcsec (optical or radio) at 85 degrees and better
28150      *      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28151      *
28152      *      <p>Without refraction, the complementary functions iauAtio13 and
28153      *      iauAtoi13 are self-consistent to better than 1 microarcsecond
28154      *      all over the celestial sphere.  With refraction included,
28155      *      consistency falls off at high zenith distances, but is still
28156      *      better than 0.05 arcsec at 85 degrees.
28157      *
28158      *  <li> It is advisable to take great care with units, as even unlikely
28159      *      values of the input parameters are accepted and processed in
28160      *      accordance with the models used.
28161      *
28162      * </ol>
28163      *  Called:
28164      * <ul>
28165      *     <li>{@link #jauApio13} astrometry parameters, CIRS-observed, 2013
28166      *     <li>{@link #jauAtoiq} quick observed to CIRS
28167      *
28168      * </ul>
28169      *@version  2013 October 9
28170      *
28171      *@since JSOFA release 20131202
28172      *
28173      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28174      * @throws JSOFAInternalError an internal error has occured
28175      * @throws JSOFAIllegalParameter 
28176      */
28177     public static SphericalCoordinate jauAtoi13(String type, double ob1, double ob2,
28178             double utc1, double utc2, double dut1,
28179             double elong, double phi, double hm, double xp, double yp,
28180             double phpa, double tc, double rh, double wl
28181             ) throws JSOFAIllegalParameter, JSOFAInternalError
28182     {
28183         Astrom astrom = new Astrom();
28184 
28185 
28186         /* Star-independent astrometry parameters for CIRS->observed. */
28187         jauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
28188                 phpa, tc, rh, wl, astrom);
28189 
28190         /* Transform observed to CIRS. */
28191         SphericalCoordinate co = jauAtoiq(type, ob1, ob2, astrom);
28192         return co;
28193         
28194         /* Finished. */
28195 
28196 
28197     }
28198 
28199     /**
28200      *  Quick observed place to CIRS, given the star-independent astrometry
28201      *  parameters.
28202      * 
28203      *  Use of this function is appropriate when efficiency is important and
28204      *  where many star positions are all to be transformed for one date.
28205      *  The star-independent astrometry parameters can be obtained by
28206      *  calling iauApio[13] or iauApco[13].
28207      *
28208      *<p>Status:  support function.
28209      *
28210      *<!-- Given: -->
28211      *     @param type    char[]      type of coordinates: "R", "H" or "A" (Note 1)
28212      *     @param ob1     double      observed Az, HA or RA (radians; Az is N=0,E=90)
28213      *     @param ob2     double      observed ZD or Dec (radians)
28214      *     @param astrom    star-independent astrometry parameters:
28215      *
28216      *<!-- Returned:-->
28217      *     @return ri      double*      <b>Returned</b> CIRS right ascension (CIO-based, radians)
28218      *             di      double*      <b>Returned</b> CIRS declination (radians)
28219      *
28220      *<p>Notes:
28221      * <ol>
28222      *
28223      *  <li> "Observed" Az,El means the position that would be seen by a
28224      *     perfect geodetically aligned theodolite.  This is related to
28225      *     the observed HA,Dec via the standard rotation, using the geodetic
28226      *     latitude (corrected for polar motion), while the observed HA and
28227      *     RA are related simply through the Earth rotation angle and the
28228      *     site longitude.  "Observed" RA,Dec or HA,Dec thus means the
28229      *     position that would be seen by a perfect equatorial with its
28230      *     polar axis aligned to the Earth's axis of rotation.  By removing
28231      *     from the observed place the effects of atmospheric refraction and
28232      *     diurnal aberration, the CIRS RA,Dec is obtained.
28233      *
28234      *  <li> Only the first character of the type argument is significant.
28235      *     "R" or "r" indicates that ob1 and ob2 are the observed right
28236      *     ascension and declination;  "H" or "h" indicates that they are
28237      *     hour angle (west +ve) and declination;  anything else ("A" or
28238      *     "a" is recommended) indicates that ob1 and ob2 are azimuth (north
28239      *     zero, east 90 deg) and zenith distance.  (Zenith distance is used
28240      *     rather than altitude in order to reflect the fact that no
28241      *     allowance is made for depression of the horizon.)
28242      *
28243      *  <li> The accuracy of the result is limited by the corrections for
28244      *     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
28245      *     Providing the meteorological parameters are known accurately and
28246      *     there are no gross local effects, the predicted observed
28247      *     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
28248      *     (radio) for a zenith distance of less than 70 degrees, better
28249      *     than 30 arcsec (optical or radio) at 85 degrees and better than
28250      *     20 arcmin (optical) or 30 arcmin (radio) at the horizon.
28251      *
28252      *     <p>Without refraction, the complementary functions iauAtioq and
28253      *     iauAtoiq are self-consistent to better than 1 microarcsecond all
28254      *     over the celestial sphere.  With refraction included, consistency
28255      *     falls off at high zenith distances, but is still better than
28256      *     0.05 arcsec at 85 degrees.
28257      *
28258      *  <li> It is advisable to take great care with units, as even unlikely
28259      *     values of the input parameters are accepted and processed in
28260      *     accordance with the models used.
28261      *
28262      * </ol>
28263      *  Called:
28264      * <ul>
28265      *     <li>{@link #jauS2c} spherical coordinates to unit vector
28266      *     <li>{@link #jauC2s} p-vector to spherical
28267      *     <li>{@link #jauAnp} normalize angle into range 0 to 2pi
28268      *
28269      * </ul>
28270      *@version  2013 October 9
28271      *
28272      *@since JSOFA release 20131202
28273      *
28274      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28275      */
28276     public static SphericalCoordinate jauAtoiq(String type,
28277             double ob1, double ob2, Astrom astrom
28278             )
28279     {
28280         char c;
28281         double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[] = new double[3],
28282         xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref,
28283         zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda,
28284         f, xhd, yhd, zhd, xpl, ypl, w;
28285 
28286 
28287         /* Coordinate type. */
28288         c = type.charAt(0);
28289 
28290         /* Coordinates. */
28291         c1 = ob1;
28292         c2 = ob2;
28293 
28294         /* Sin, cos of latitude. */
28295         sphi = astrom.sphi;
28296         cphi = astrom.cphi;
28297 
28298         /* Standardize coordinate type. */
28299         if ( c == 'r' || c == 'R' ) {
28300             c = 'R';
28301         } else if ( c == 'h' || c == 'H' ) {
28302             c = 'H';
28303         } else {
28304             c = 'A';
28305         }
28306 
28307         /* If Az,ZD, convert to Cartesian (S=0,E=90). */
28308         if ( c == 'A' ) {
28309             ce = sin(c2);
28310             xaeo = - cos(c1) * ce;
28311             yaeo = sin(c1) * ce;
28312             zaeo = cos(c2);
28313 
28314         } else {
28315 
28316             /* If RA,Dec, convert to HA,Dec. */
28317             if ( c == 'R' ) c1 = astrom.eral - c1;
28318 
28319             /* To Cartesian -HA,Dec. */
28320             v = jauS2c ( -c1, c2 );
28321             xmhdo = v[0];
28322             ymhdo = v[1];
28323             zmhdo = v[2];
28324 
28325             /* To Cartesian Az,El (S=0,E=90). */
28326             xaeo = sphi*xmhdo - cphi*zmhdo;
28327             yaeo = ymhdo;
28328             zaeo = cphi*xmhdo + sphi*zmhdo;
28329         }
28330 
28331         /* Azimuth (S=0,E=90). */
28332         az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0;
28333 
28334         /* Sine of observed ZD, and observed ZD. */
28335         sz = sqrt ( xaeo*xaeo + yaeo*yaeo );
28336         zdo = atan2 ( sz, zaeo );
28337 
28338         /*
28339          * Refraction
28340          * ----------
28341          */
28342 
28343         /* Fast algorithm using two constant model. */
28344         refa = astrom.refa;
28345         refb = astrom.refb;
28346         tz = sz / zaeo;
28347         dref = ( refa + refb*tz*tz ) * tz;
28348         zdt = zdo + dref;
28349 
28350         /* To Cartesian Az,ZD. */
28351         ce = sin(zdt);
28352         xaet = cos(az) * ce;
28353         yaet = sin(az) * ce;
28354         zaet = cos(zdt);
28355 
28356         /* Cartesian Az,ZD to Cartesian -HA,Dec. */
28357         xmhda = sphi*xaet + cphi*zaet;
28358         ymhda = yaet;
28359         zmhda = - cphi*xaet + sphi*zaet;
28360 
28361         /* Diurnal aberration. */
28362         f = ( 1.0 + astrom.diurab*ymhda );
28363         xhd = f * xmhda;
28364         yhd = f * ( ymhda - astrom.diurab );
28365         zhd = f * zmhda;
28366 
28367         /* Polar motion. */
28368         xpl = astrom.xpl;
28369         ypl = astrom.ypl;
28370         w = xpl*xhd - ypl*yhd + zhd;
28371         v[0] = xhd - xpl*w;
28372         v[1] = yhd + ypl*w;
28373         v[2] = w - ( xpl*xpl + ypl*ypl ) * zhd;
28374 
28375         /* To spherical -HA,Dec. */
28376         SphericalCoordinate co = jauC2s(v);
28377 
28378         /* Right ascension. */
28379         co.alpha = jauAnp(astrom.eral + co.alpha);
28380 
28381         return co;
28382         /* Finished. */
28383 
28384 
28385     }
28386 
28387     /**
28388      *  Apply light deflection by a solar-system body, as part of
28389      *  transforming coordinate direction into natural direction.
28390      *
28391      *<p>This function is derived from the International Astronomical Union's
28392      *  SOFA (Standards of Fundamental Astronomy) software collection.
28393      *
28394      *<p>Status:  support function.
28395      *
28396      *<!-- Given: -->
28397      *     @param bm      double      mass of the gravitating body (solar masses)
28398      *     @param p       double[3]   direction from observer to source (unit vector)
28399      *     @param q       double[3]   direction from body to source (unit vector)
28400      *     @param e       double[3]   direction from body to observer (unit vector)
28401      *     @param em      double      distance from body to observer (au)
28402      *     @param dlim    double      deflection limiter (Note 4)
28403      *
28404      *<!-- Returned:-->
28405      *     @return p1      double[3]    <b>Returned</b> observer to deflected source (unit vector)
28406      *
28407      *<p>Notes:
28408      * <ol>
28409      *
28410      *  <li> The algorithm is based on Expr. (70) in Klioner (2003) and
28411      *     Expr. (7.63) in the Explanatory Supplement (Urban &amp; Seidelmann
28412      *     2013), with some rearrangement to minimize the effects of machine
28413      *     precision.
28414      *
28415      *  <li> The mass parameter bm can, as required, be adjusted in order to
28416      *     allow for such effects as quadrupole field.
28417      *
28418      *  <li> The barycentric position of the deflecting body should ideally
28419      *     correspond to the time of closest approach of the light ray to
28420      *     the body.
28421      *
28422      *  <li> The deflection limiter parameter dlim is phi^2/2, where phi is
28423      *     the angular separation (in radians) between source and body at
28424      *     which limiting is applied.  As phi shrinks below the chosen
28425      *     threshold, the deflection is artificially reduced, reaching zero
28426      *     for phi = 0.
28427      *
28428      *  <li> The returned vector p1 is not normalized, but the consequential
28429      *     departure from unit magnitude is always negligible.
28430      *
28431      *  <li> The arguments p and p1 can be the same array.
28432      *
28433      *  <li> To accumulate total light deflection taking into account the
28434      *     contributions from several bodies, call the present function for
28435      *     each body in succession, in decreasing order of distance from the
28436      *     observer.
28437      *
28438      *  <li> For efficiency, validation is omitted.  The supplied vectors must
28439      *     be of unit magnitude, and the deflection limiter non-zero and
28440      *     positive.
28441      *
28442      * </ol>
28443      *<p>References:
28444      * <ul>
28445      *
28446      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28447      *     the Astronomical Almanac, 3rd ed., University Science Books
28448      *     (2013).
28449      *
28450      * <li> Klioner, Sergei A., "A practical relativistic model for micro-
28451      *     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
28452      *
28453      * </ul>
28454      *  Called:
28455      * <ul>
28456      *     <li>{@link #jauPdp} scalar product of two p-vectors
28457      *     <li>{@link #jauPxp} vector product of two p-vectors
28458      *
28459      * </ul>
28460      *@version  2013 October 9
28461      *
28462      *@since JSOFA release 20131202
28463      *
28464      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28465      */
28466     public static double[] jauLd(double bm, double p[], double q[], double e[],
28467             double em, double dlim)
28468     {
28469         int i;
28470         double qpe[] = new double[3], qdqpe, w, eq[], peq[] ;
28471 
28472         double p1[] = new double[3];
28473 
28474         /* q . (q + e). */
28475         for (i = 0; i < 3; i++) {
28476             qpe[i] = q[i] + e[i];
28477         }
28478         qdqpe = jauPdp(q, qpe);
28479 
28480         /* 2 x G x bm / ( em x c^2 x ( q . (q + e) ) ). */
28481         w = bm * SRS / em / max(qdqpe,dlim);
28482 
28483         /* p x (e x q). */
28484         eq = jauPxp(e, q);
28485         peq = jauPxp(p, eq);
28486 
28487         /* Apply the deflection. */
28488         for (i = 0; i < 3; i++) {
28489             p1[i] = p[i] + w*peq[i];
28490         }
28491 
28492         return p1;
28493         /* Finished. */
28494 
28495 
28496     }
28497 
28498     /*+
28499      *  - - - - - - -
28500      *   i a u L d n
28501      *  - - - - - - -
28502      *
28503      *  For a star, apply light deflection by multiple solar-system bodies,
28504      *  as part of transforming coordinate direction into natural direction.
28505      *
28506      *<p>This function is derived from the International Astronomical Union's
28507      *  SOFA (Standards of Fundamental Astronomy) software collection.
28508      *
28509      *<p>Status:  support function.
28510      *
28511      *<!-- Given: -->
28512      *     n    int           number of bodies (note 1)
28513      *     b    jauLDBODY[n]  data for each of the n bodies (Notes 1,2):
28514      *      bm   double         mass of the body (solar masses, Note 3)
28515      *      dl   double         deflection limiter (Note 4)
28516      *      pv   [2][3]         barycentric PV of the body (au, au/day)
28517      *     ob   double[3]     barycentric position of the observer (au)
28518      *     sc   double[3]     observer to star coord direction (unit vector)
28519      *
28520      *<!-- Returned:-->
28521      *     sn    double[3]      observer to deflected star (unit vector)
28522      *
28523      *  <li> The array b contains n entries, one for each body to be
28524      *     considered.  If n = 0, no gravitational light deflection will be
28525      *     applied, not even for the Sun.
28526      *
28527      *  <li> The array b should include an entry for the Sun as well as for
28528      *     any planet or other body to be taken into account.  The entries
28529      *     should be in the order in which the light passes the body.
28530      *
28531      *  <li> In the entry in the b array for body i, the mass parameter
28532      *     b[i].bm can, as required, be adjusted in order to allow for such
28533      *     effects as quadrupole field.
28534      *
28535      *  <li> The deflection limiter parameter b[i].dl is phi^2/2, where phi is
28536      *     the angular separation (in radians) between star and body at
28537      *     which limiting is applied.  As phi shrinks below the chosen
28538      *     threshold, the deflection is artificially reduced, reaching zero
28539      *     for phi = 0.   Example values suitable for a terrestrial
28540      *     observer, together with masses, are as follows:
28541      *
28542      *        body i     b[i].bm        b[i].dl
28543      *
28544      *        Sun        1.0            6e-6
28545      *        Jupiter    0.00095435     3e-9
28546      *        Saturn     0.00028574     3e-10
28547      *
28548      *  <li> For cases where the starlight passes the body before reaching the
28549      *     observer, the body is placed back along its barycentric track by
28550      *     the light time from that point to the observer.  For cases where
28551      *     the body is "behind" the observer no such shift is applied.  If
28552      *     a different treatment is preferred, the user has the option of
28553      *     instead using the iauLd function.  Similarly, iauLd can be used
28554      *     for cases where the source is nearby, not a star.
28555      *
28556      *  <li> The returned vector sn is not normalized, but the consequential
28557      *     departure from unit magnitude is always negligible.
28558      *
28559      *  <li> The arguments sc and sn can be the same array.
28560      *
28561      *  <li> For efficiency, validation is omitted.  The supplied masses must
28562      *     be greater than zero, the position and velocity vectors must be
28563      *     right, and the deflection limiter greater than zero.
28564      *
28565      *  Reference:
28566      *
28567      *     Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28568      *     the Astronomical Almanac, 3rd ed., University Science Books
28569      *     (2013), Section 7.2.4.
28570      *
28571      *  Called:
28572      *     iauCp        copy p-vector
28573      *     iauPdp       scalar product of two p-vectors
28574      *     iauPmp       p-vector minus p-vector
28575      *     iauPpsp      p-vector plus scaled p-vector
28576      *     iauPn        decompose p-vector into modulus and direction
28577      *     iauLd        light deflection by a solar-system body
28578      *
28579      *@version  2013 October 9
28580      *
28581      *@since JSOFA release 20131202
28582      *
28583      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28584      */
28585     public static double[] jauLdn(int n, Ldbody b[], double ob[], double sc[])
28586     {
28587         /* Light time for 1 au (days) */
28588         final double CR = AULT/DAYSEC;
28589 
28590         int i;
28591         double v[] , dt, ev[], sn[] = new double[3];
28592 
28593 
28594         /* Star direction prior to deflection. */
28595         jauCp(sc, sn);
28596 
28597         /* Body by body. */
28598         for ( i = 0; i < n; i++ ) {
28599 
28600             /* Body to observer vector at epoch of observation (au). */
28601             v = jauPmp( ob, b[i].pv[0]);
28602 
28603             /* Minus the time since the light passed the body (days). */
28604             dt = jauPdp(sn,v) * CR;
28605 
28606             /* Neutralize if the star is "behind" the observer. */
28607             dt = min(dt, 0.0);
28608 
28609             /* Backtrack the body to the time the light was passing the body. */
28610             ev = jauPpsp(v, -dt, b[i].pv[1]);
28611 
28612             /* Body to observer vector as magnitude and direction. */
28613             NormalizedVector nv = jauPn(ev);
28614             
28615             /* Apply light deflection for this body. */
28616             sn = jauLd( b[i].bm, sn, sn, nv.u, nv.r, b[i].dl );
28617 
28618             /* Next body. */
28619         }
28620         return sn;
28621 
28622         /* Finished. */
28623 
28624 
28625     }
28626 
28627     /**
28628      *   Deflection of starlight by the Sun.
28629      *
28630      *<p>This function is derived from the International Astronomical Union's
28631      *  SOFA (Standards of Fundamental Astronomy) software collection.
28632      *
28633      *<p>Status:  support function.
28634      *
28635      *<!-- Given: -->
28636      *     @param p       double[3]   direction from observer to star (unit vector)
28637      *     @param e       double[3]   direction from Sun to observer (unit vector)
28638      *     @param em      double      distance from Sun to observer (au)
28639      *
28640      *<!-- Returned:-->
28641      *     @return p1      double[3]    <b>Returned</b> observer to deflected start (unit vector)
28642      *
28643      *<p>Notes:
28644      * <ol>
28645      *
28646      *  <li> The source is presumed to be sufficiently distant that its
28647      *     directions seen from the Sun and the observer are essentially
28648      *     the same.
28649      *
28650      *  <li> The deflection is restrained when the angle between the star and
28651      *     the center of the Sun is less than a threshold value, falling to
28652      *     zero deflection for zero separation.  The chosen threshold value
28653      *     is within the solar limb for all solar-system applications, and
28654      *     is about 5 arcminutes for the case of a terrestrial observer.
28655      *
28656      *  <li> The arguments p and p1 can be the same array.
28657      *
28658      * </ol>
28659      *  Called:
28660      * <ul>
28661      *     <li>{@link #jauLd} light deflection by a solar-system body
28662      *
28663      * </ul>
28664      *@version  2016 July 29
28665      *
28666      *@since JSOFA release 20131202
28667      *
28668      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28669      */
28670     public static double[] jauLdsun(double p[], double e[], double em)
28671     {
28672         double em2, dlim;
28673 
28674 
28675         /* Deflection limiter (smaller for distant observers). */
28676         em2 = em*em;
28677         if ( em2 < 1.0 ) em2 = 1.0;
28678         dlim = 1e-6 / (em2 > 1.0 ? em2 : 1.0);
28679         
28680         /* Apply the deflection. */
28681         return jauLd(1.0, p, p, e, em, dlim);
28682 
28683     }
28684 
28685     /**
28686      *  Proper motion and parallax.
28687      *
28688      *<p>This function is derived from the International Astronomical Union's
28689      *  SOFA (Standards of Fundamental Astronomy) software collection.
28690      *
28691      *<p>Status:  support function.
28692      *
28693      *<!-- Given: -->
28694      *     @param rc double      ICRS RA,Dec at catalog epoch (radians)
28695      *     @param dc double      ICRS RA,Dec at catalog epoch (radians) 
28696      *     @param pr      double      RA proper motion (radians/year; Note 1)
28697      *     @param pd      double      Dec proper motion (radians/year)
28698      *     @param px      double      parallax (arcsec)
28699      *     @param rv      double      radial velocity (km/s, +ve if receding)
28700      *     @param pmt     double      proper motion time interval (SSB, Julian years)
28701      *     @param pob     double[3]   SSB to observer vector (au)
28702      *
28703      *<!-- Returned:-->
28704      *     @return pco     double[3]    <b>Returned</b> coordinate direction (BCRS unit vector)
28705      *
28706      *<p>Notes:
28707      * <ol>
28708      *
28709      *  <li> The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
28710      *
28711      *  <li> The proper motion time interval is for when the starlight
28712      *     reaches the solar system barycenter.
28713      *
28714      *  <li> To avoid the need for iteration, the Roemer effect (i.e. the
28715      *     small annual modulation of the proper motion coming from the
28716      *     changing light time) is applied approximately, using the
28717      *     direction of the star at the catalog epoch.
28718      *
28719      * </ol>
28720      *<p>References:
28721      * <ul>
28722      *
28723      * <li> 1984 Astronomical Almanac, pp B39-B41.
28724      *
28725      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28726      *     the Astronomical Almanac, 3rd ed., University Science Books
28727      *     (2013), Section 7.2.
28728      *
28729      * </ul>
28730      *  Called:
28731      * <ul>
28732      *     <li>{@link #jauPdp} scalar product of two p-vectors
28733      *     <li>{@link #jauPn} decompose p-vector into modulus and direction
28734      *
28735      * </ul>
28736      *@version  2013 October 9
28737      *
28738      *@since JSOFA release 20131202
28739      *
28740      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28741      */
28742     public static double[] jauPmpx(double rc, double dc, double pr, double pd,
28743             double px, double rv, double pmt, double pob[]
28744             )
28745     {
28746         /* Km/s to au/year */
28747         final double VF = DAYSEC*DJM/DAU;
28748 
28749         /* Light time for 1 au, Julian years */
28750         final double AULTY = AULT/DAYSEC/DJY;
28751 
28752         int i;
28753         double sr, cr, sd, cd, x, y, z, p[] = new double[3], dt, pxr, w, pdz, pm[] = new double[3];
28754 
28755 
28756         /* Spherical coordinates to unit vector (and useful functions). */
28757         sr = sin(rc);
28758         cr = cos(rc);
28759         sd = sin(dc);
28760         cd = cos(dc);
28761         p[0] = x = cr*cd;
28762         p[1] = y = sr*cd;
28763         p[2] = z = sd;
28764 
28765         /* Proper motion time interval (y) including Roemer effect. */
28766         dt = pmt + jauPdp(p,pob)*AULTY;
28767 
28768         /* Space motion (radians per year). */
28769         pxr = px * DAS2R;
28770         w = VF * rv * pxr;
28771         pdz = pd * z;
28772         pm[0] = - pr*y - pdz*cr + w*x;
28773         pm[1] =   pr*x - pdz*sr + w*y;
28774         pm[2] =   pd*cd + w*z;
28775 
28776         /* Coordinate direction of star (unit vector, BCRS). */
28777         for (i = 0; i < 3; i++) {
28778             p[i] += dt*pm[i] - pxr*pob[i];
28779         }
28780         NormalizedVector pco = jauPn(p);
28781 
28782         return pco.u;
28783         /* Finished. */
28784 
28785 
28786     }
28787 
28788     /**
28789      *  Star proper motion:  update star catalog data for space motion, with
28790      *  special handling to handle the zero parallax case.
28791      *
28792      *<p>This function is derived from the International Astronomical Union's
28793      *  SOFA (Standards of Fundamental Astronomy) software collection.
28794      *
28795      *<p>Status:  support function.
28796      *
28797      *<!-- Given: -->
28798      *     @param ra1     double       right ascension (radians), before
28799      *     @param dec1    double       declination (radians), before
28800      *     @param pmr1    double       RA proper motion (radians/year), before
28801      *     @param pmd1    double       Dec proper motion (radians/year), before
28802      *     @param px1     double       parallax (arcseconds), before
28803      *     @param rv1     double       radial velocity (km/s, +ve = receding), before
28804      *     @param ep1a    double       "before" epoch, part A (Note 1)
28805      *     @param ep1b    double       "before" epoch, part B (Note 1)
28806      *     @param ep2a    double       "after" epoch, part A (Note 1)
28807      *     @param ep2b    double       "after" epoch, part B (Note 1)
28808      *
28809      *<!-- Returned:-->
28810      *     @return ra2     double        <b>Returned</b> right ascension (radians), after
28811      *             dec2    double        <b>Returned</b> declination (radians), after
28812      *             pmr2    double        <b>Returned</b> RA proper motion (radians/year), after
28813      *             pmd2    double        <b>Returned</b> Dec proper motion (radians/year), after
28814      *             px2     double        <b>Returned</b> parallax (arcseconds), after
28815      *             rv2     double        <b>Returned</b> radial velocity (km/s, +ve = receding), after
28816      *
28817      *  
28818      *  @throws JSOFAInternalError          int         status:
28819      *                         -1  =   <b>Returned</b> system error (should not occur)
28820      *                          0  =   <b>Returned</b> no warnings or errors
28821      *                          1  =   <b>Returned</b> distance overridden (Note 6)
28822      *                          2  =   <b>Returned</b> excessive velocity (Note 7)
28823      *                          4  =   <b>Returned</b> solution didn't converge (Note 8)
28824      *                        else  =   <b>Returned</b> binary logical OR of the above warnings
28825      *
28826      *<p>Notes:
28827      * <ol>
28828      *
28829      *  <li> The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are
28830      *     Julian Dates, apportioned in any convenient way between the two
28831      *     parts (A and B).  For example, JD(TDB)=2450123.7 could be
28832      *     expressed in any of these ways, among others:
28833      *
28834      *            <p>epNa            epNb
28835      *
28836      *         2450123.7           0.0       (JD method)
28837      *         2451545.0       -1421.3       (J2000 method)
28838      *         2400000.5       50123.2       (MJD method)
28839      *         2450123.5           0.2       (date &amp; time method)
28840      *
28841      *     <p>The JD method is the most natural and convenient to use in cases
28842      *     where the loss of several decimal digits of resolution is
28843      *     acceptable.  The J2000 method is best matched to the way the
28844      *     argument is handled internally and will deliver the optimum
28845      *     resolution.  The MJD method and the date &amp; time methods are both
28846      *     good compromises between resolution and convenience.
28847      *
28848      *  <li> In accordance with normal star-catalog conventions, the object's
28849      *     right ascension and declination are freed from the effects of
28850      *     secular aberration.  The frame, which is aligned to the catalog
28851      *     equator and equinox, is Lorentzian and centered on the SSB.
28852      *
28853      *     <p>The proper motions are the rate of change of the right ascension
28854      *     and declination at the catalog epoch and are in radians per TDB
28855      *     Julian year.
28856      *
28857      *     <p>The parallax and radial velocity are in the same frame.
28858      *
28859      *  <li> Care is needed with units.  The star coordinates are in radians
28860      *     and the proper motions in radians per Julian year, but the
28861      *     parallax is in arcseconds.
28862      *
28863      *  <li> The RA proper motion is in terms of coordinate angle, not true
28864      *     angle.  If the catalog uses arcseconds for both RA and Dec proper
28865      *     motions, the RA proper motion will need to be divided by cos(Dec)
28866      *     before use.
28867      *
28868      *  <li> Straight-line motion at constant speed, in the inertial frame, is
28869      *     assumed.
28870      *
28871      *  <li> An extremely small (or zero or negative) parallax is overridden
28872      *     to ensure that the object is at a finite but very large distance,
28873      *     but not so large that the proper motion is equivalent to a large
28874      *     but safe speed (about 0.1c using the chosen constant).  A warning
28875      *     status of 1 is added to the status if this action has been taken.
28876      *
28877      *  <li> If the space velocity is a significant fraction of c (see the
28878      *     constant VMAX in the function iauStarpv), it is arbitrarily set
28879      *     to zero.  When this action occurs, 2 is added to the status.
28880      *
28881      *  <li> The relativistic adjustment carried out in the iauStarpv function
28882      *     involves an iterative calculation.  If the process fails to
28883      *     converge within a set number of iterations, 4 is added to the
28884      *     status.
28885      *
28886      * </ol>
28887      *  Called:
28888      * <ul>
28889      *     <li>{@link #jauSeps} angle between two points
28890      *     <li>{@link #jauStarpm} update star catalog data for space motion
28891      *
28892      * </ul>
28893      *@version  2013 October 9
28894      *
28895      *@since JSOFA release 20131202
28896      *
28897      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
28898      * @throws JSOFAInternalError an internal error has occured
28899      */
28900     public static CatalogCoords jauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
28901             double px1, double rv1,
28902             double ep1a, double ep1b, double ep2a, double ep2b) throws JSOFAInternalError
28903     {
28904 
28905         /* Minimum allowed parallax (arcsec) */
28906         final double PXMIN = 5e-7;
28907 
28908         /* Factor giving maximum allowed transverse speed of about 1% c */
28909         final double F = 326.0;
28910 
28911         double pm, px1a;
28912 
28913 
28914         /* Proper motion in one year (radians). */
28915         pm = jauSeps(ra1, dec1, ra1+pmr1, dec1+pmd1);
28916 
28917         
28918         px1a = px1;
28919         pm *= F;
28920         if (px1a < pm) {px1a = pm;}
28921         if (px1a < PXMIN) {px1a = PXMIN;}
28922 
28923         /* Carry out the transformation using the modified parallax. */
28924         return jauStarpm(ra1, dec1, pmr1, pmd1, px1a, rv1,
28925                 ep1a, ep1b, ep2a, ep2b);
28926 
28927          /* Finished. */
28928 
28929 
28930     }
28931 
28932     /**
28933      *  Position and velocity of a terrestrial observing station.
28934      *
28935      *<p>This function is derived from the International Astronomical Union's
28936      *  SOFA (Standards of Fundamental Astronomy) software collection.
28937      *
28938      *<p>Status:  support function.
28939      *
28940      *<!-- Given: -->
28941      *     @param elong    double        longitude (radians, east +ve, Note 1)
28942      *     @param phi      double        latitude (geodetic, radians, Note 1)
28943      *     @param hm       double        height above ref. ellipsoid (geodetic, m)
28944      *     @param xp double        coordinates of the pole (radians, Note 2)
28945      *     @param yp double        coordinates of the pole (radians, Note 2) 
28946      *     @param sp       double        the TIO locator s' (radians, Note 2)
28947      *     @param theta    double        Earth rotation angle (radians, Note 3)
28948      *
28949      *<!-- Returned:-->
28950      *     @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
28951      *
28952      *<p>Notes:
28953      * <ol>
28954      *
28955      *  <li> The terrestrial coordinates are with respect to the WGS84
28956      *     reference ellipsoid.
28957      *
28958      *  <li> xp and yp are the coordinates (in radians) of the Celestial
28959      *     Intermediate Pole with respect to the International Terrestrial
28960      *     Reference System (see IERS Conventions), measured along the
28961      *     meridians 0 and 90 deg west respectively.  sp is the TIO locator
28962      *     s', in radians, which positions the Terrestrial Intermediate
28963      *     Origin on the equator.  For many applications, xp, yp and
28964      *     (especially) sp can be set to zero.
28965      *
28966      *  <li> If theta is Greenwich apparent sidereal time instead of Earth
28967      *     rotation angle, the result is with respect to the true equator
28968      *     and equinox of date, i.e. with the x-axis at the equinox rather
28969      *     than the celestial intermediate origin.
28970      *
28971      *  <li> The velocity units are meters per UT1 second, not per SI second.
28972      *     This is unlikely to have any practical consequences in the modern
28973      *     era.
28974      *
28975      *  <li> No validation is performed on the arguments.  Error cases that
28976      *     could lead to arithmetic exceptions are trapped by the iauGd2gc
28977      *     function, and the result set to zeros.
28978      *
28979      * </ol>
28980      *<p>References:
28981      * <ul>
28982      *
28983      * <li> McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
28984      *     IERS Technical Note No. 32, BKG (2004)
28985      *
28986      * <li> Urban, S. &amp; Seidelmann, P. K. (eds), Explanatory Supplement to
28987      *     the Astronomical Almanac, 3rd ed., University Science Books
28988      *     (2013), Section 7.4.3.3.
28989      *
28990      * </ul>
28991      *  Called:
28992      * <ul>
28993      *     <li>{@link #jauGd2gc} geodetic to geocentric transformation
28994      *     <li>{@link #jauPom00} polar motion matrix
28995      *     <li>{@link #jauTrxp} product of transpose of r-matrix and p-vector
28996      *
28997      * </ul>
28998      *@version  2013 October 9
28999      *
29000      * @since JSOFA release 20131202
29001      *
29002      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29003      * @throws JSOFAInternalError an internal error has occured
29004      * @throws JSOFAIllegalParameter 
29005      */
29006     public static double [][] jauPvtob(double elong, double phi, double hm,
29007             double xp, double yp, double sp, double theta
29008             ) throws JSOFAIllegalParameter, JSOFAInternalError
29009     {
29010 
29011         double xyzm[];
29012 
29013         /* Geodetic to geocentric transformation (WGS84). */
29014         xyzm = jauGd2gc(1, elong, phi, hm);
29015 
29016         return jauPvtob(xyzm, xp, yp, sp, theta );
29017         /* Finished. */
29018 
29019 
29020     }
29021     
29022     /**
29023      * Alternative Position and velocity of a terrestrial observing station with observatory position already in cartesian.
29024      * @see JSOFA#jauPvtob(double, double, double, double, double, double, double) for more detail.
29025      * @param xyzm observatory geocentric position in metres.
29026      * @param xp double        coordinates of the pole (radians, Note 2)
29027      * @param yp double        coordinates of the pole (radians, Note 2) 
29028      * @param sp       double        the TIO locator s' (radians, Note 2)
29029      * @param theta    double        Earth rotation angle (radians, Note 3)
29030      * @return pv       double[2][3]   <b>Returned</b> position/velocity vector (m, m/s, CIRS)
29031      * @throws JSOFAIllegalParameter
29032      * @throws JSOFAInternalError an internal error has occured
29033      */
29034     public static double [][] jauPvtob(double xyzm[],
29035             double xp, double yp, double sp, double theta
29036             ) throws JSOFAIllegalParameter, JSOFAInternalError
29037     {
29038         /* Earth rotation rate in radians per UT1 second */
29039         final double OM = 1.00273781191135448 * D2PI / DAYSEC;
29040 
29041         double rpm[][], xyz[], x, y, z, s, c;
29042         double pv[][] = new double[2][3];
29043 
29044       
29045         /* Polar motion and TIO position. */
29046         rpm = jauPom00(xp, yp, sp);
29047         xyz = jauTrxp(rpm, xyzm);
29048         x = xyz[0];
29049         y = xyz[1];
29050         z = xyz[2];
29051 
29052         /* Functions of ERA. */
29053         s = sin(theta);
29054         c = cos(theta);
29055 
29056         /* Position. */
29057         pv[0][0] = c*x - s*y;
29058         pv[0][1] = s*x + c*y;
29059         pv[0][2] = z;
29060 
29061         /* Velocity. */
29062         pv[1][0] = OM * ( -s*x - c*y );
29063         pv[1][1] = OM * (  c*x - s*y );
29064         pv[1][2] = 0.0;
29065 
29066         return pv;
29067         /* Finished. */
29068 
29069 
29070     }
29071 
29072     /**
29073      * constants A and B in the atmospheric refraction model
29074      *  dZ = A tan Z + B tan^3 Z.
29075      *  .
29076      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 28 Mar 2014
29077      * @version $Revision$ $date$
29078      */
29079     public static class RefCos {
29080         /**    refraction coefficient A  */
29081         public double    a ;
29082 
29083         /**    refraction coefficient B  */
29084         public double    b ;
29085         public RefCos(double a, double b) {
29086           this.a = a;
29087           this.b = b;
29088        }
29089        
29090    }
29091 
29092     /**
29093      *  Determine the constants A and B in the atmospheric refraction model
29094      *  dZ = A tan Z + B tan^3 Z.
29095      *
29096      *  Z is the "observed" zenith distance (i.e. affected by refraction)
29097      *  and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
29098      *  zenith distance.
29099      *
29100      *<p>This function is derived from the International Astronomical Union's
29101      *  SOFA (Standards of Fundamental Astronomy) software collection.
29102      *
29103      *<p>Status:  support function.
29104      *
29105      *<!-- Given: -->
29106      *    @param phpa    double     pressure at the observer (hPa = millibar)
29107      *    @param tc      double     ambient temperature at the observer (deg C)
29108      *    @param rh      double     relative humidity at the observer (range 0-1)
29109      *    @param wl      double     wavelength (micrometers)
29110      *
29111      *<!-- Returned:-->
29112      *    @return      <b>Returned</b> tan Z coefficient (radians)
29113      *                 <b>Returned</b> tan^3 Z coefficient (radians)
29114      *
29115      *<p>Notes:
29116      * <ol>
29117      *
29118      *  <li> The model balances speed and accuracy to give good results in
29119      *     applications where performance at low altitudes is not paramount.
29120      *     Performance is maintained across a range of conditions, and
29121      *     applies to both optical/IR and radio.
29122      *
29123      *  <li> The model omits the effects of (i) height above sea level (apart
29124      *     from the reduced pressure itself), (ii) latitude (i.e. the
29125      *     flattening of the Earth), (iii) variations in tropospheric lapse
29126      *     rate and (iv) dispersive effects in the radio.
29127      *
29128      *     <p>The model was tested using the following range of conditions:
29129      *
29130      *       <p>lapse rates 0.0055, 0.0065, 0.0075 deg/meter
29131      *       latitudes 0, 25, 50, 75 degrees
29132      *       heights 0, 2500, 5000 meters ASL
29133      *       pressures mean for height -10% to +5% in steps of 5%
29134      *       temperatures -10 deg to +20 deg with respect to 280 deg at SL
29135      *       relative humidity 0, 0.5, 1
29136      *       wavelengths 0.4, 0.6, ... 2 micron, + radio
29137      *       zenith distances 15, 45, 75 degrees
29138      *
29139      *     <p>The accuracy with respect to raytracing through a model
29140      *     atmosphere was as follows:
29141      *
29142      *                            <p>worst         RMS
29143      *
29144      *       <p>optical/IR           62 mas       8 mas
29145      *       radio               319 mas      49 mas
29146      *
29147      *     <p>For this particular set of conditions:
29148      *
29149      *       <p>lapse rate 0.0065 K/meter
29150      *       latitude 50 degrees
29151      *       sea level
29152      *       pressure 1005 mb
29153      *       temperature 280.15 K
29154      *       humidity 80%
29155      *       wavelength 5740 Angstroms
29156      *
29157      *     <p>the results were as follows:
29158      *
29159      *       <p>ZD       raytrace     iauRefco   Saastamoinen
29160      *
29161      *       10         10.27        10.27        10.27
29162      *       20         21.19        21.20        21.19
29163      *       30         33.61        33.61        33.60
29164      *       40         48.82        48.83        48.81
29165      *       45         58.16        58.18        58.16
29166      *       50         69.28        69.30        69.27
29167      *       55         82.97        82.99        82.95
29168      *       60        100.51       100.54       100.50
29169      *       65        124.23       124.26       124.20
29170      *       70        158.63       158.68       158.61
29171      *       72        177.32       177.37       177.31
29172      *       74        200.35       200.38       200.32
29173      *       76        229.45       229.43       229.42
29174      *       78        267.44       267.29       267.41
29175      *       80        319.13       318.55       319.10
29176      *
29177      *      <p>deg        arcsec       arcsec       arcsec
29178      *
29179      *     <p>The values for Saastamoinen's formula (which includes terms
29180      *     up to tan^5) are taken from Hohenkerk and Sinclair (1985).
29181      *
29182      *  <li> A wl value in the range 0-100 selects the optical/IR case and is
29183      *     wavelength in micrometers.  Any value outside this range selects
29184      *     the radio case.
29185      *
29186      *  <li> Outlandish input parameters are silently limited to
29187      *     mathematically safe values.  Zero pressure is permissible, and
29188      *     causes zeroes to be returned.
29189      *
29190      *  <li> The algorithm draws on several sources, as follows:
29191      *
29192      *     <p>a) The formula for the saturation vapour pressure of water as
29193      *        a function of temperature and temperature is taken from
29194      *        Equations (A4.5-A4.7) of Gill (1982).
29195      *
29196      *     <p>b) The formula for the water vapour pressure, given the
29197      *        saturation pressure and the relative humidity, is from
29198      *        Crane (1976), Equation (2.5.5).
29199      *
29200      *     <p>c) The refractivity of air is a function of temperature,
29201      *        total pressure, water-vapour pressure and, in the case
29202      *        of optical/IR, wavelength.  The formulae for the two cases are
29203      *        developed from Hohenkerk &amp; Sinclair (1985) and Rueger (2002).
29204      *
29205      *     <p>d) The formula for beta, the ratio of the scale height of the
29206      *        atmosphere to the geocentric distance of the observer, is
29207      *        an adaption of Equation (9) from Stone (1996).  The
29208      *        adaptations, arrived at empirically, consist of (i) a small
29209      *        adjustment to the coefficient and (ii) a humidity term for the
29210      *        radio case only.
29211      *
29212      *     <p>e) The formulae for the refraction constants as a function of
29213      *        n-1 and beta are from Green (1987), Equation (4.31).
29214      *
29215      * </ol>
29216      *<p>References:
29217      * <ul>
29218      *
29219      * <li> Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral
29220      *     Atmosphere", Methods of Experimental Physics: Astrophysics 12B,
29221      *     Academic Press, 1976.
29222      *
29223      * <li> Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press,
29224      *     1982.
29225      *
29226      * <li> Green, R.M., "Spherical Astronomy", Cambridge University Press,
29227      *     1987.
29228      *
29229      * <li> Hohenkerk, C.Y., &amp; Sinclair, A.T., NAO Technical Note No. 63,
29230      *     1985.
29231      *
29232      * <li> Rueger, J.M., "Refractive Index Formulae for Electronic Distance
29233      *     Measurement with Radio and Millimetre Waves", in Unisurv Report
29234      *     S-68, School of Surveying and Spatial Information Systems,
29235      *     University of New South Wales, Sydney, Australia, 2002.
29236      *
29237      * <li> Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996.
29238      *
29239      * </ul>
29240      *@version  2013 October 9
29241      *
29242      *@since JSOFA release 20131202
29243      *
29244      *  <!-- Copyright (C) 2013 IAU SOFA Board.  See notes at end. -->
29245      */
29246     public static RefCos jauRefco(double phpa, double tc, double rh, double wl )
29247     {
29248         boolean optic;
29249         double p, t, r, w, ps, pw, tk, wlsq, gamma, beta;
29250 
29251 
29252         /* Decide whether optical/IR or radio case:  switch at 100 microns. */
29253         optic = ( wl <= 100.0 );
29254 
29255         /* Restrict parameters to safe values. */
29256         t = max ( tc, -150.0 );
29257         t = min ( t, 200.0 );
29258         p = max ( phpa, 0.0 );
29259         p = min ( p, 10000.0 );
29260         r = max ( rh, 0.0 );
29261         r = min ( r, 1.0 );
29262         w = max ( wl, 0.1 );
29263         w = min ( w, 1e6 );
29264 
29265         /* Water vapour pressure at the observer. */
29266         if ( p > 0.0 ) {
29267             ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) /
29268                     ( 1.0 + 0.00412*t ) ) *
29269                     ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t )  );
29270             pw = r * ps / ( 1.0 - (1.0-r)*ps/p );
29271         } else {
29272             pw = 0.0;
29273         }
29274 
29275         /* Refractive index minus 1 at the observer. */
29276         tk = t + 273.15;
29277         if ( optic ) {
29278             wlsq = w * w;
29279             gamma = ( ( 77.53484e-6 +
29280                     ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p
29281                     - 11.2684e-6*pw ) / tk;
29282         } else {
29283             gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk;
29284         }
29285 
29286         /* Formula for beta from Stone, with empirical adjustments. */
29287         beta = 4.4474e-6 * tk;
29288         if ( ! optic ) beta -= 0.0074 * pw * beta;
29289 
29290         /* Refraction constants from Green. */
29291         return new RefCos( gamma * ( 1.0 - beta ),
29292                - gamma * ( beta - gamma / 2.0 ));
29293 
29294         /* Finished. */
29295 
29296 
29297     }
29298  
29299     
29300     /**
29301     *  Transformation from Galactic Coordinates to ICRS.
29302     *
29303     *  This function is derived from the International Astronomical Union's
29304     *  SOFA (Standards of Fundamental Astronomy) software collection.
29305     *
29306     *  <p>Status:  support routine.
29307     *
29308     *  @param   dl     double      galactic longitude (radians)
29309     *  @param   db     double      galactic latitude (radians)
29310     *
29311     *  @return co ICRS right ascension, declination.
29312     *
29313     *  <p>Notes:<ol>
29314     *
29315     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29316     *     respect to the now obsolete reference system FK4 B1950.0.  When
29317     *     interpreting the system in a modern context, several factors have
29318     *     to be taken into account:<ul>
29319     *
29320     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29321     *
29322     *     <li> The distortion of the FK4 proper motion system by differential
29323     *       Galactic rotation.
29324     *
29325     *     <li> The use of the B1950.0 equinox rather than the now-standard
29326     *       J2000.0.
29327     *
29328     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29329     *  </ul>
29330     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29331     *     matrix that transforms directly between ICRS and Galactic
29332     *     coordinates with the above factors taken into account.  The
29333     *     matrix is derived from three angles, namely the ICRS coordinates
29334     *     of the Galactic pole and the longitude of the ascending node of
29335     *     the galactic equator on the ICRS equator.  They are given in
29336     *     degrees to five decimal places and for canonical purposes are
29337     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29338     *     elements are given to 10 decimal places (about 20 microarcsec).
29339     *     In the present SOFA function the matrix elements have been
29340     *     recomputed from the canonical three angles and are given to 30
29341     *     decimal places.
29342     *
29343     *  <li> The inverse transformation is performed by the function jauIcrs2g.
29344     *  </ol>
29345     *
29346     *  Reference:
29347     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29348     *     catalogues.  Astrometric and photometric star catalogues
29349     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29350     *     Publications Division, Noordwijk, Netherlands.
29351     *
29352     *  @version  2015 March 02
29353     * 
29354     *
29355     *  @since JSOFA release 20150209
29356     *
29357     */
29358     public static SphericalCoordinate jauG2icrs ( double dl, double db)
29359     {
29360        double v1[], v2[];
29361 
29362     /*
29363     *  L2,B2 system of galactic coordinates in the form presented in the
29364     *  Hipparcos Catalogue.  In degrees:
29365     *
29366     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29367     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29368     *  R =  32.93192    longitude of the ascending node of the Galactic
29369     *                   plane on the ICRS equator
29370     *
29371     *  ICRS to galactic rotation matrix, obtained by computing
29372     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29373     */
29374        double r[][]  = new double[][]{ { -0.054875560416215368492398900454,
29375                             -0.873437090234885048760383168409,
29376                             -0.483835015548713226831774175116 },
29377                           { +0.494109427875583673525222371358,
29378                             -0.444829629960011178146614061616,
29379                             +0.746982244497218890527388004556 },
29380                           { -0.867666149019004701181616534570,
29381                             -0.198076373431201528180486091412,
29382                             +0.455983776175066922272100478348 } };
29383 
29384 
29385     /* Spherical to Cartesian. */
29386        v1 = jauS2c(dl, db);
29387 
29388     /* Galactic to ICRS. */
29389        v2 = jauTrxp(r, v1);
29390 
29391     /* Cartesian to spherical. */
29392        SphericalCoordinate co = jauC2s(v2);
29393 
29394     /* Express in conventional ranges. */
29395        co.alpha = jauAnp(co.alpha);
29396        co.delta = jauAnpm(co.delta);
29397 
29398     /* Finished. */
29399       return co;
29400     }
29401  
29402     
29403     
29404     /**
29405     *  Transformation from ICRS to Galactic Coordinates.
29406     *
29407     *  This function is derived from the International Astronomical Union's
29408     *  SOFA (Standards of Fundamental Astronomy) software collection.
29409     *
29410     *  <p>Status:  support routine.
29411     *
29412     *     @param dr     double      ICRS right ascension (radians)
29413     *     @param dd     double      ICRS declination (radians)
29414     *
29415     *  @return co galactic longitude (radians), galactic latitude (radians)
29416     *
29417     *  <p>Notes:<ol>
29418     *
29419     *  <li> The IAU 1958 system of Galactic coordinates was defined with
29420     *     respect to the now obsolete reference system FK4 B1950.0.  When
29421     *     interpreting the system in a modern context, several factors have
29422     *     to be taken into account:<ul>
29423     *
29424     *     <li> The inclusion in FK4 positions of the E-terms of aberration.
29425     *
29426     *     <li> The distortion of the FK4 proper motion system by differential
29427     *       Galactic rotation.
29428     *
29429     *     <li> The use of the B1950.0 equinox rather than the now-standard
29430     *       J2000.0.
29431     *
29432     *     <li> The frame bias between ICRS and the J2000.0 mean place system.
29433     *     </ul>
29434     *     The Hipparcos Catalogue (Perryman &amp; ESA 1997) provides a rotation
29435     *     matrix that transforms directly between ICRS and Galactic
29436     *     coordinates with the above factors taken into account.  The
29437     *     matrix is derived from three angles, namely the ICRS coordinates
29438     *     of the Galactic pole and the longitude of the ascending node of
29439     *     the galactic equator on the ICRS equator.  They are given in
29440     *     degrees to five decimal places and for canonical purposes are
29441     *     regarded as exact.  In the Hipparcos Catalogue the matrix
29442     *     elements are given to 10 decimal places (about 20 microarcsec).
29443     *     In the present SOFA function the matrix elements have been
29444     *     recomputed from the canonical three angles and are given to 30
29445     *     decimal places.
29446     *
29447     *  <li> The inverse transformation is performed by the function iauG2icrs.
29448     *  </ol>
29449     *  Reference:
29450     *     Perryman M.A.C. &amp; ESA, 1997, ESA SP-1200, The Hipparcos and Tycho
29451     *     catalogues.  Astrometric and photometric star catalogues
29452     *     derived from the ESA Hipparcos Space Astrometry Mission.  ESA
29453     *     Publications Division, Noordwijk, Netherlands.
29454     *
29455     *  @version   2015 January 20
29456     *
29457     *  @since JSOFA release 20150209
29458     *
29459     */
29460     public static SphericalCoordinate jauIcrs2g ( double dr, double dd )
29461     {
29462        double v1[], v2[];
29463 
29464     /*
29465     *  L2,B2 system of galactic coordinates in the form presented in the
29466     *  Hipparcos Catalogue.  In degrees:
29467     *
29468     *  P = 192.85948    right ascension of the Galactic north pole in ICRS
29469     *  Q =  27.12825    declination of the Galactic north pole in ICRS
29470     *  R =  32.93192    longitude of the ascending node of the Galactic
29471     *                   plane on the ICRS equator
29472     *
29473     *  ICRS to galactic rotation matrix, obtained by computing
29474     *  R_3(-R) R_1(pi/2-Q) R_3(pi/2+P) to the full precision shown:
29475     */
29476        double r[][] = new double[][] { { -0.054875560416215368492398900454,
29477                             -0.873437090234885048760383168409,
29478                             -0.483835015548713226831774175116 },
29479                           { +0.494109427875583673525222371358,
29480                             -0.444829629960011178146614061616,
29481                             +0.746982244497218890527388004556 },
29482                           { -0.867666149019004701181616534570,
29483                             -0.198076373431201528180486091412,
29484                             +0.455983776175066922272100478348 } };
29485 
29486 
29487     /* Spherical to Cartesian. */
29488        v1 = jauS2c(dr, dd);
29489 
29490     /* ICRS to Galactic. */
29491        v2 = jauRxp(r, v1);
29492 
29493     /* Cartesian to spherical. */
29494        SphericalCoordinate co = jauC2s(v2);
29495 
29496     /* Express in conventional ranges. */
29497        co.alpha = jauAnp(co.alpha);
29498        co.delta = jauAnpm(co.delta);
29499        return co;
29500     }
29501 
29502 // 2016-05-03 additions below    
29503     
29504     /**
29505     *
29506     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29507     *  of date) to ICRS RA,Dec, using the IAU 2006 precession model.
29508     *
29509     * <p>This function is derived from the International Astronomical Union's
29510     *  SOFA (Standards of Fundamental Astronomy) software collection.
29511     *
29512     *  <p>Status:  support function.
29513     *
29514     *  <!-- Given: -->
29515     *     @param date1 double TT as a 2-part Julian date (Note 1)
29516     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29517     *     @param dl double ecliptic longitude and latitude (radians)
29518     *     @param db double ecliptic longitude and latitude (radians) 
29519     *
29520     * <!-- Returned: -->
29521     *     @return      double ICRS right ascension and declination (radians)
29522     *
29523     *<ol>
29524     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29525     *     convenient way between the two arguments.  For example,
29526     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29527     *     among others:
29528     *
29529     *            date1          date2
29530     *
29531     *         2450123.7           0.0       (JD method)
29532     *         2451545.0       -1421.3       (J2000 method)
29533     *         2400000.5       50123.2       (MJD method)
29534     *         2450123.5           0.2       (date &amp; time method)
29535     *
29536     *     The JD method is the most natural and convenient to use in
29537     *     cases where the loss of several decimal digits of resolution
29538     *     is acceptable.  The J2000 method is best matched to the way
29539     *     the argument is handled internally and will deliver the
29540     *     optimum resolution.  The MJD method and the date &amp; time methods
29541     *     are both good compromises between resolution and convenience.
29542     *
29543     *  <li> No assumptions are made about whether the coordinates represent
29544     *     starlight and embody astrometric effects such as parallax or
29545     *     aberration.
29546     *
29547     *  <li> The transformation is approximately that from ecliptic longitude
29548     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29549     *     right ascension and declination, with only frame bias (always
29550     *     less than 25 mas) to disturb this classical picture.
29551     *</ol>
29552     *  Called: <ul>
29553     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29554     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29555     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29556     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29557     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29558     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29559     *</ul>
29560     *
29561     *   @version  2016 February 9
29562     *
29563     *  @since JSOFA release 20160503
29564     *
29565     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29566     */
29567     public static SphericalCoordinate jauEceq06(double date1, double date2, double dl, double db)
29568     {
29569 
29570 
29571     /* Spherical to Cartesian. */
29572        double v1[] = jauS2c(dl, db);
29573 
29574     /* Rotation matrix, ICRS equatorial to ecliptic. */
29575        double rm[][] = jauEcm06(date1, date2);
29576 
29577     /* The transformation from ecliptic to ICRS. */
29578        double v2[] = jauTrxp(rm, v1);
29579 
29580     /* Cartesian to spherical. */
29581        SphericalCoordinate co = jauC2s(v2);
29582 
29583     /* Express in conventional ranges. */
29584        co.alpha = jauAnp(co.alpha);
29585        co.delta = jauAnpm(co.delta);
29586 
29587        return co;
29588     }
29589 
29590     /**
29591     *
29592     *  ICRS equatorial to ecliptic rotation matrix, IAU 2006.
29593     *
29594     * <p>This function is derived from the International Astronomical Union's
29595     *  SOFA (Standards of Fundamental Astronomy) software collection.
29596     *
29597     *  <p>Status:  support function.
29598     *
29599     *  <!-- Given: -->
29600     *    @param date1 double         TT as a 2-part Julian date (Note 1)
29601     *    @param date2 double         TT as a 2-part Julian date (Note 1) 
29602     *
29603     * <!-- Returned: -->
29604     *     @return          double[3][3]   ICRS to ecliptic rotation matrix
29605     *
29606     *  <p>Notes: <ol>
29607     *
29608     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29609     *     convenient way between the two arguments.  For example,
29610     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29611     *     among others:
29612     *
29613     *            date1          date2
29614     *
29615     *         2450123.7           0.0       (JD method)
29616     *         2451545.0       -1421.3       (J2000 method)
29617     *         2400000.5       50123.2       (MJD method)
29618     *         2450123.5           0.2       (date &amp; time method)
29619     *
29620     *     The JD method is the most natural and convenient to use in
29621     *     cases where the loss of several decimal digits of resolution
29622     *     is acceptable.  The J2000 method is best matched to the way
29623     *     the argument is handled internally and will deliver the
29624     *     optimum resolution.  The MJD method and the date &amp; time methods
29625     *     are both good compromises between resolution and convenience.
29626     *
29627     *  <li> The matrix is in the sense
29628     *
29629     *        E_ep = rm x P_ICRS,
29630     *
29631     *     where P_ICRS is a vector with respect to ICRS right ascension
29632     *     and declination axes and E_ep is the same vector with respect to
29633     *     the (inertial) ecliptic and equinox of date.
29634     *
29635     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
29636     *     magnitude, and not bound to any particular spatial origin, such
29637     *     as the Earth, Sun or SSB.  No assumptions are made about whether
29638     *     it represents starlight and embodies astrometric effects such as
29639     *     parallax or aberration.  The transformation is approximately that
29640     *     between mean J2000.0 right ascension and declination and ecliptic
29641     *     longitude and latitude, with only frame bias (always less than
29642     *     25 mas) to disturb this classical picture.
29643     *  </ol>
29644     *  Called: <ul>
29645     *     <li>{@link #jauObl06}     mean obliquity, IAU 2006
29646     *     <li>{@link #jauPmat06}    PB matrix, IAU 2006
29647     *     <li>{@link #jauIr}        initialize r-matrix to identity
29648     *     <li>{@link #jauRx}        rotate around X-axis
29649     *     <li>{@link #jauRxr}       product of two r-matrices
29650     *</ul>
29651     *
29652     *   @version  2015 December 11
29653     *
29654     *  @since JSOFA release 20160503
29655     *
29656     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29657     */
29658     public static double[][] jauEcm06(double date1, double date2)
29659     {
29660        double ob, e[][] = new double[3][3];
29661 
29662 
29663     /* Obliquity, IAU 2006. */
29664        ob = jauObl06(date1, date2);
29665 
29666     /* Precession-bias matrix, IAU 2006. */
29667        double bp[][] = jauPmat06(date1, date2);
29668 
29669     /* Equatorial of date to ecliptic matrix. */
29670        jauIr(e);
29671        jauRx(ob, e);
29672 
29673     /* ICRS to ecliptic coordinates rotation matrix, IAU 2006. */
29674        return jauRxr(e, bp);
29675 
29676     }
29677 
29678     /**
29679     *
29680     *  Transformation from ICRS equatorial coordinates to ecliptic
29681     *  coordinates (mean equinox and ecliptic of date) using IAU 2006
29682     *  precession model.
29683     *
29684     * <p>This function is derived from the International Astronomical Union's
29685     *  SOFA (Standards of Fundamental Astronomy) software collection.
29686     *
29687     *  <p>Status:  support function.
29688     *
29689     *  <!-- Given: -->
29690     *     @param date1 double TT as a 2-part Julian date (Note 1)
29691     *     @param date2 double TT as a 2-part Julian date (Note 1) 
29692     *     @param dr double ICRS right ascension and declination (radians)
29693     *     @param dd double ICRS right ascension and declination (radians) 
29694     *
29695     * <!-- Returned: -->
29696     *     @return      double ecliptic longitude and latitude (radians)
29697     *<ol>
29698     *  <li> The TT date date1+date2 is a Julian Date, apportioned in any
29699     *     convenient way between the two arguments.  For example,
29700     *     JD(TT)=2450123.7 could be expressed in any of these ways,
29701     *     among others:
29702     *
29703     *            date1          date2
29704     *
29705     *         2450123.7           0.0       (JD method)
29706     *         2451545.0       -1421.3       (J2000 method)
29707     *         2400000.5       50123.2       (MJD method)
29708     *         2450123.5           0.2       (date &amp; time method)
29709     *
29710     *     The JD method is the most natural and convenient to use in
29711     *     cases where the loss of several decimal digits of resolution
29712     *     is acceptable.  The J2000 method is best matched to the way
29713     *     the argument is handled internally and will deliver the
29714     *     optimum resolution.  The MJD method and the date &amp; time methods
29715     *     are both good compromises between resolution and convenience.
29716     *
29717     *  <li> No assumptions are made about whether the coordinates represent
29718     *     starlight and embody astrometric effects such as parallax or
29719     *     aberration.
29720     *
29721     *  <li> The transformation is approximately that from mean J2000.0 right
29722     *     ascension and declination to ecliptic longitude and latitude
29723     *     (mean equinox and ecliptic of date), with only frame bias (always
29724     *     less than 25 mas) to disturb this classical picture.
29725     *</ol>
29726     *  Called:<ul>
29727     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29728     *     <li>{@link #jauEcm06}     J2000.0 to ecliptic rotation matrix, IAU 2006
29729     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
29730     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29731     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29732     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29733     *</ul>
29734     *   @version  2016 February 9
29735     *
29736     *  @since JSOFA release 20160503
29737     *
29738     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29739     */
29740     public static SphericalCoordinate jauEqec06(double date1, double date2, double dr, double dd)
29741     {
29742 
29743     /* Spherical to Cartesian. */
29744       double v1[] = jauS2c(dr, dd);
29745 
29746     /* Rotation matrix, ICRS equatorial to ecliptic. */
29747       double rm[][] = jauEcm06(date1, date2);
29748 
29749     /* The transformation from ICRS to ecliptic. */
29750        double v2[] = jauRxp(rm, v1);
29751 
29752     /* Cartesian to spherical. */
29753        SphericalCoordinate co = jauC2s(v2);
29754 
29755     /* Express in conventional ranges. */
29756        co.alpha = jauAnp(co.alpha);
29757        co.delta = jauAnpm(co.delta);
29758        return co;
29759 
29760     }
29761 
29762     /**
29763     *
29764     *  Transformation from ecliptic coordinates (mean equinox and ecliptic
29765     *  of date) to ICRS RA,Dec, using a long-term precession model.
29766     *
29767     * <p>This function is derived from the International Astronomical Union's
29768     *  SOFA (Standards of Fundamental Astronomy) software collection.
29769     *
29770     *  <p>Status:  support function.
29771     *
29772     *  <!-- Given: -->
29773     *    @param  epj     double     Julian epoch (TT)
29774     *    @param dl double     ecliptic longitude and latitude (radians)
29775     *    @param db double     ecliptic longitude and latitude (radians) 
29776     *
29777     * <!-- Returned: -->
29778     *     @return   double     ICRS right ascension and declination (radians)
29779     *<ol>
29780     *  <li> No assumptions are made about whether the coordinates represent
29781     *     starlight and embody astrometric effects such as parallax or
29782     *     aberration.
29783     *
29784     *  <li> The transformation is approximately that from ecliptic longitude
29785     *     and latitude (mean equinox and ecliptic of date) to mean J2000.0
29786     *     right ascension and declination, with only frame bias (always
29787     *     less than 25 mas) to disturb this classical picture.
29788     *
29789     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29790     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29791     *     100 microarcseconds during the 20th and 21st centuries.  It is
29792     *     accurate to a few arcseconds throughout the historical period,
29793     *     worsening to a few tenths of a degree at the end of the
29794     *     +/- 200,000 year time span.
29795     *</ol>
29796     *  Called:<ul>
29797     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29798     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
29799     *     <li>{@link #jauTrxp}      product of transpose of r-matrix and p-vector
29800     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29801     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29802     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29803     *</ul>
29804     *  References: <ul>
29805     *
29806     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29807     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29808     *    A22
29809     *
29810     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29811     *    expressions, valid for long time intervals (Corrigendum),
29812     *    Astron.Astrophys. 541, C1
29813     *</ul>
29814     *   @version  2016 February 9
29815     *
29816     *  @since JSOFA release 20160503
29817     *
29818     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29819     */
29820     public static SphericalCoordinate jauLteceq(double epj, double dl, double db)
29821     {
29822 
29823     /* Spherical to Cartesian. */
29824        double v1[] = jauS2c(dl, db);
29825 
29826     /* Rotation matrix, ICRS equatorial to ecliptic. */
29827        double rm[][] = jauLtecm(epj);
29828 
29829     /* The transformation from ecliptic to ICRS. */
29830        double v2[] = jauTrxp(rm, v1);
29831 
29832     /* Cartesian to spherical. */
29833        SphericalCoordinate co = jauC2s(v2);
29834 
29835     /* Express in conventional ranges. */
29836        co.alpha = jauAnp(co.alpha);
29837        co.delta = jauAnpm(co.delta);
29838        return co;
29839 
29840     }
29841 
29842     /**
29843     *
29844     *  ICRS equatorial to ecliptic rotation matrix, long-term.
29845     *
29846     * <p>This function is derived from the International Astronomical Union's
29847     *  SOFA (Standards of Fundamental Astronomy) software collection.
29848     *
29849     *  <p>Status:  support function.
29850     *
29851     *  <!-- Given: -->
29852     *     @param epj     double         Julian epoch (TT)
29853     *
29854     * <!-- Returned: -->
29855     *     @return      double[3][3]   ICRS to ecliptic rotation matrix
29856     *
29857     *  <p>Notes: <ol>
29858     *
29859     *  <li> The matrix is in the sense
29860     *
29861     *        E_ep = rm x P_ICRS,
29862     *
29863     *     where P_ICRS is a vector with respect to ICRS right ascension
29864     *     and declination axes and E_ep is the same vector with respect to
29865     *     the (inertial) ecliptic and equinox of epoch epj.
29866     *
29867     *  <li> P_ICRS is a free vector, merely a direction, typically of unit
29868     *     magnitude, and not bound to any particular spatial origin, such
29869     *     as the Earth, Sun or SSB.  No assumptions are made about whether
29870     *     it represents starlight and embodies astrometric effects such as
29871     *     parallax or aberration.  The transformation is approximately that
29872     *     between mean J2000.0 right ascension and declination and ecliptic
29873     *     longitude and latitude, with only frame bias (always less than
29874     *     25 mas) to disturb this classical picture.
29875     *
29876     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29877     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29878     *     100 microarcseconds during the 20th and 21st centuries.  It is
29879     *     accurate to a few arcseconds throughout the historical period,
29880     *     worsening to a few tenths of a degree at the end of the
29881     *     +/- 200,000 year time span.
29882     *</ol>
29883     *  Called:<ul>
29884     *     <li>{@link #jauLtpequ}    equator pole, long term
29885     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
29886     *     <li>{@link #jauPxp}       vector product
29887     *     <li>{@link #jauPn}        normalize vector
29888     *</ul>
29889     *  References:<ul>
29890     *
29891     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29892     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29893     *    A22
29894     *
29895     *    <li>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29896     *    expressions, valid for long time intervals (Corrigendum),
29897     *    Astron.Astrophys. 541, C1
29898     *</ul>
29899     *   @version  2015 December 6
29900     *
29901     *  @since JSOFA release 20160503
29902     *
29903     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
29904     */
29905     public static double[][] jauLtecm(double epj)
29906     {
29907        double rm[][] = new double[3][3];
29908     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
29909        final double dx = -0.016617 * DAS2R,
29910                     de = -0.0068192 * DAS2R,
29911                     dr = -0.0146 * DAS2R;
29912 
29913 
29914     /* Equator pole. */
29915        double p[] = jauLtpequ(epj);
29916 
29917     /* Ecliptic pole (bottom row of equatorial to ecliptic matrix). */
29918        double z[] = jauLtpecl(epj);
29919 
29920     /* Equinox (top row of matrix). */
29921        double w[] = jauPxp(p, z);
29922        NormalizedVector nv = jauPn(w);
29923 
29924        double x[] = nv.u;
29925     /* Middle row of matrix. */
29926        double y[] = jauPxp(z, x);
29927 
29928     /* Combine with frame bias. */
29929        rm[0][0] =   x[0]    - x[1]*dr + x[2]*dx;
29930        rm[0][1] =   x[0]*dr + x[1]    + x[2]*de;
29931        rm[0][2] = - x[0]*dx - x[1]*de + x[2];
29932        rm[1][0] =   y[0]    - y[1]*dr + y[2]*dx;
29933        rm[1][1] =   y[0]*dr + y[1]    + y[2]*de;
29934        rm[1][2] = - y[0]*dx - y[1]*de + y[2];
29935        rm[2][0] =   z[0]    - z[1]*dr + z[2]*dx;
29936        rm[2][1] =   z[0]*dr + z[1]    + z[2]*de;
29937        rm[2][2] = - z[0]*dx - z[1]*de + z[2];
29938 
29939        return rm;
29940 
29941     }
29942 
29943     /**
29944     *
29945     *  Transformation from ICRS equatorial coordinates to ecliptic
29946     *  coordinates (mean equinox and ecliptic of date) using a long-term
29947     *  precession model.
29948     *
29949     * <p>This function is derived from the International Astronomical Union's
29950     *  SOFA (Standards of Fundamental Astronomy) software collection.
29951     *
29952     *  <p>Status:  support function.
29953     *
29954     *  <!-- Given: -->
29955     *     @param epj     double     Julian epoch (TT)
29956     *     @param dr   double     ICRS right ascension and declination (radians)
29957     *     @param dd   double     ICRS right ascension and declination (radians)
29958     *
29959     * <!-- Returned: -->
29960     *     @return     ecliptic longitude and latitude (radians)
29961     *<ol>
29962     *  <li> No assumptions are made about whether the coordinates represent
29963     *     starlight and embody astrometric effects such as parallax or
29964     *     aberration.
29965     *
29966     *  <li> The transformation is approximately that from mean J2000.0 right
29967     *     ascension and declination to ecliptic longitude and latitude
29968     *     (mean equinox and ecliptic of date), with only frame bias (always
29969     *     less than 25 mas) to disturb this classical picture.
29970     *
29971     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
29972     *     agrees with the IAU 2006 precession at J2000.0 and stays within
29973     *     100 microarcseconds during the 20th and 21st centuries.  It is
29974     *     accurate to a few arcseconds throughout the historical period,
29975     *     worsening to a few tenths of a degree at the end of the
29976     *     +/- 200,000 year time span.
29977     *</ol>
29978     *  Called:<ul>
29979     *     <li>{@link #jauS2c}       spherical coordinates to unit vector
29980     *     <li>{@link #jauLtecm}     J2000.0 to ecliptic rotation matrix, long term
29981     *     <li>{@link #jauRxp}       product of r-matrix and p-vector
29982     *     <li>{@link #jauC2s}       unit vector to spherical coordinates
29983     *     <li>{@link #jauAnp}       normalize angle into range 0 to 2pi
29984     *     <li>{@link #jauAnpm}      normalize angle into range +/- pi
29985     *</ul>
29986     *  References:
29987     *
29988     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
29989     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
29990     *    A22
29991     *
29992     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
29993     *    expressions, valid for long time intervals (Corrigendum),
29994     *    Astron.Astrophys. 541, C1
29995     *
29996     *   @version  2016 February 9
29997     *
29998     *  @since JSOFA release 20160503
29999     *
30000     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30001     */
30002     public static SphericalCoordinate jauLteqec(double epj, double dr, double dd)
30003     {
30004 
30005     /* Spherical to Cartesian. */
30006        double v1[] = jauS2c(dr, dd);
30007 
30008     /* Rotation matrix, ICRS equatorial to ecliptic. */
30009        double rm[][] = jauLtecm(epj);
30010 
30011     /* The transformation from ICRS to ecliptic. */
30012        double v2[] = jauRxp(rm, v1);
30013 
30014     /* Cartesian to spherical. */
30015        SphericalCoordinate co = jauC2s(v2);
30016 
30017     /* Express in conventional ranges. */
30018       co.alpha = jauAnp(co.alpha);
30019       co.delta = jauAnpm(co.delta);
30020 
30021      return co;
30022     }
30023 
30024     /**
30025     *
30026     *  Long-term precession matrix.
30027     *
30028     * <p>This function is derived from the International Astronomical Union's
30029     *  SOFA (Standards of Fundamental Astronomy) software collection.
30030     *
30031     *  <p>Status:  support function.
30032     *
30033     *  <!-- Given: -->
30034     *     @param epj     double         Julian epoch (TT)
30035     *
30036     * <!-- Returned: -->
30037     *     @return      double[3][3]   precession matrix, J2000.0 to date
30038     *
30039     *  <p>Notes: <ol>
30040     *
30041     *  <li> The matrix is in the sense
30042     *
30043     *        P_date = rp x P_J2000,
30044     *
30045     *     where P_J2000 is a vector with respect to the J2000.0 mean
30046     *     equator and equinox and P_date is the same vector with respect to
30047     *     the equator and equinox of epoch epj.
30048     *
30049     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30050     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30051     *     100 microarcseconds during the 20th and 21st centuries.  It is
30052     *     accurate to a few arcseconds throughout the historical period,
30053     *     worsening to a few tenths of a degree at the end of the
30054     *     +/- 200,000 year time span.
30055     *</ol>
30056     *  Called:<ul>
30057     *     <li>{@link #jauLtpequ}    equator pole, long term
30058     *     <li>{@link #jauLtpecl}    ecliptic pole, long term
30059     *     <li>{@link #jauPxp}       vector product
30060     *     <li>{@link #jauPn}        normalize vector
30061     *</ul>
30062     *  References:
30063     *
30064     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30065     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30066     *    A22
30067     *
30068     *    <p>Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30069     *    expressions, valid for long time intervals (Corrigendum),
30070     *    Astron.Astrophys. 541, C1
30071     *
30072     *   @version  2015 December 6
30073     *
30074     *  @since JSOFA release 20160503
30075     *
30076     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30077     */
30078     public static double[][] jauLtp(double epj )
30079     {
30080        double rp[][] = new double[3][3];
30081        int i;
30082        
30083 
30084 
30085     /* Equator pole (bottom row of matrix). */
30086        double peqr[] = jauLtpequ(epj);
30087 
30088     /* Ecliptic pole. */
30089        double pecl[] = jauLtpecl(epj);
30090 
30091     /* Equinox (top row of matrix). */
30092        double v[] = jauPxp(peqr, pecl);
30093        NormalizedVector nv = jauPn(v);
30094 
30095     /* Middle row of matrix. */
30096        v = jauPxp(peqr, nv.u);
30097 
30098     /* Assemble the matrix. */
30099        for ( i = 0; i < 3; i++ ) {
30100           rp[0][i] = nv.u[i];
30101           rp[1][i] = v[i];
30102           rp[2][i] = peqr[i];
30103        }
30104 
30105        return rp;
30106     }
30107 
30108 
30109     /**
30110     *
30111     *  Long-term precession matrix, including ICRS frame bias.
30112     *
30113     * <p>This function is derived from the International Astronomical Union's
30114     *  SOFA (Standards of Fundamental Astronomy) software collection.
30115     *
30116     *  <p>Status:  support function.
30117     *
30118     *  <!-- Given: -->
30119     *     @param epj     double         Julian epoch (TT)
30120     *
30121     * <!-- Returned: -->
30122     *     @return     double[3][3]   precession-bias matrix, J2000.0 to date
30123     *
30124     *  <p>Notes: <ol>
30125     *
30126     *  <li> The matrix is in the sense
30127     *
30128     *        P_date = rpb x P_ICRS,
30129     *
30130     *     where P_ICRS is a vector in the Geocentric Celestial Reference
30131     *     System, and P_date is the vector with respect to the Celestial
30132     *     Intermediate Reference System at that date but with nutation
30133     *     neglected.
30134     *
30135     *  <li> A first order frame bias formulation is used, of sub-
30136     *     microarcsecond accuracy compared with a full 3D rotation.
30137     *
30138     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30139     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30140     *     100 microarcseconds during the 20th and 21st centuries.  It is
30141     *     accurate to a few arcseconds throughout the historical period,
30142     *     worsening to a few tenths of a degree at the end of the
30143     *     +/- 200,000 year time span.
30144     *</ol>
30145     *  References:
30146     *
30147     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30148     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30149     *    A22
30150     *
30151     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30152     *    expressions, valid for long time intervals (Corrigendum),
30153     *    Astron.Astrophys. 541, C1
30154     *
30155     *   @version  2015 December 6
30156     *
30157     *  @since JSOFA release 20160503
30158     *
30159     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30160     */
30161     public static double[][] jauLtpb(double epj)
30162     {
30163         double rpb[][] = new double[3][3];
30164     /* Frame bias (IERS Conventions 2010, Eqs. 5.21 and 5.33) */
30165        final double dx = -0.016617 * DAS2R,
30166                     de = -0.0068192 * DAS2R,
30167                     dr = -0.0146 * DAS2R;
30168 
30169        int i;
30170       
30171 
30172 
30173     /* Precession matrix. */
30174         double rp[][] = jauLtp(epj);
30175 
30176     /* Apply the bias. */
30177        for ( i = 0; i < 3; i++ ) {
30178           rpb[i][0] =  rp[i][0]    - rp[i][1]*dr + rp[i][2]*dx;
30179           rpb[i][1] =  rp[i][0]*dr + rp[i][1]    + rp[i][2]*de;
30180           rpb[i][2] = -rp[i][0]*dx - rp[i][1]*de + rp[i][2];
30181        }
30182 
30183       return rpb;
30184     }
30185 
30186     /**
30187     *
30188     *  Long-term precession of the ecliptic.
30189     *
30190     * <p>This function is derived from the International Astronomical Union's
30191     *  SOFA (Standards of Fundamental Astronomy) software collection.
30192     *
30193     *  <p>Status:  support function.
30194     *
30195     *  <!-- Given: -->
30196     *     @param epj     double         Julian epoch (TT)
30197     *
30198     * <!-- Returned: -->
30199     *     @return     double[3]      ecliptic pole unit vector
30200     *
30201     *  <p>Notes: <ol>
30202     *
30203     *  <li> The returned vector is with respect to the J2000.0 mean equator
30204     *     and equinox.
30205     *
30206     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30207     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30208     *     100 microarcseconds during the 20th and 21st centuries.  It is
30209     *     accurate to a few arcseconds throughout the historical period,
30210     *     worsening to a few tenths of a degree at the end of the
30211     *     +/- 200,000 year time span.
30212     *</ol>
30213     *  References:
30214     *
30215     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30216     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30217     *    A22
30218     *
30219     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30220     *    expressions, valid for long time intervals (Corrigendum),
30221     *    Astron.Astrophys. 541, C1
30222     *
30223     *   @version  2016 February 9
30224     *
30225     *  @since JSOFA release 20160503
30226     *
30227     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30228     */
30229     public static double[] jauLtpecl(double epj)
30230     {
30231         
30232        double vec[] = new double[3];
30233     /* Obliquity at J2000.0 (radians). */
30234        final double eps0 = 84381.406 * DAS2R;
30235 
30236     /* Polynomial coefficients */
30237         final int NPOL = 4 ;
30238         final double pqpol[][] = {
30239           { 5851.607687,
30240               -0.1189000,
30241               -0.00028913,
30242                0.000000101},
30243           {-1600.886300,
30244                1.1689818,
30245               -0.00000020,
30246               -0.000000437}
30247        };
30248 
30249     /* Periodic coefficients */
30250        final double pqper[][] = {
30251           { 708.15,-5486.751211,-684.661560,  667.666730,-5523.863691},
30252           {2309.00,  -17.127623,2446.283880,-2354.886252, -549.747450},
30253           {1620.00, -617.517403, 399.671049, -428.152441, -310.998056},
30254           { 492.20,  413.442940,-356.652376,  376.202861,  421.535876},
30255           {1183.00,   78.614193,-186.387003,  184.778874,  -36.776172},
30256           { 622.00, -180.732815,-316.800070,  335.321713, -145.278396},
30257           { 882.00,  -87.676083, 198.296701, -185.138669,  -34.744450},
30258           { 547.00,   46.140315, 101.135679, -120.972830,   22.885731}
30259        };
30260        final int NPER = pqper.length;
30261 
30262     /* Miscellaneous */
30263        int i;
30264        double t, p, q, w, a, s, c;
30265 
30266 
30267     /* Centuries since J2000. */
30268        t  = ( epj - 2000.0 ) / 100.0;
30269 
30270     /* Initialize P_A and Q_A accumulators. */
30271        p = 0.0;
30272        q = 0.0;
30273 
30274     /* Periodic terms. */
30275        w = D2PI*t;
30276        for ( i = 0; i < NPER; i++ ) {
30277           a = w/pqper[i][0];
30278           s = sin(a);
30279           c = cos(a);
30280           p += c*pqper[i][1] + s*pqper[i][3];
30281           q += c*pqper[i][2] + s*pqper[i][4];
30282        }
30283 
30284     /* Polynomial terms. */
30285        w = 1.0;
30286        for ( i = 0; i < NPOL; i++ ) {
30287           p += pqpol[0][i]*w;
30288           q += pqpol[1][i]*w;
30289           w *= t;
30290        }
30291 
30292     /* P_A and Q_A (radians). */
30293        p *= DAS2R;
30294        q *= DAS2R;
30295 
30296     /* Form the ecliptic pole vector. */
30297        w = 1.0 - p*p - q*q;
30298        w = w < 0.0 ? 0.0 : sqrt(w);
30299        s = sin(eps0);
30300        c = cos(eps0);
30301        vec[0] = p;
30302        vec[1] = - q*c - w*s;
30303        vec[2] = - q*s + w*c;
30304 
30305        return vec;
30306 
30307     }
30308 
30309     /**
30310     *
30311     *  Long-term precession of the equator.
30312     *
30313     * <p>This function is derived from the International Astronomical Union's
30314     *  SOFA (Standards of Fundamental Astronomy) software collection.
30315     *
30316     *  <p>Status:  support function.
30317     *
30318     *  <!-- Given: -->
30319     *     @param epj     double         Julian epoch (TT)
30320     *
30321     * <!-- Returned: -->
30322     *     @return     double[3]      equator pole unit vector
30323     *
30324     *  <p>Notes: <ol>
30325     *
30326     *  <li> The returned vector is with respect to the J2000.0 mean equator
30327     *     and equinox.
30328     *
30329     *  <li> The Vondrak et al. (2011, 2012) 400 millennia precession model
30330     *     agrees with the IAU 2006 precession at J2000.0 and stays within
30331     *     100 microarcseconds during the 20th and 21st centuries.  It is
30332     *     accurate to a few arcseconds throughout the historical period,
30333     *     worsening to a few tenths of a degree at the end of the
30334     *     +/- 200,000 year time span.
30335     *</ol>
30336     *  References:
30337     *
30338     *    Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession
30339     *    expressions, valid for long time intervals, Astron.Astrophys. 534,
30340     *    A22
30341     *
30342     *    Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession
30343     *    expressions, valid for long time intervals (Corrigendum),
30344     *    Astron.Astrophys. 541, C1
30345     *
30346     *   @version  2016 February 9
30347     *
30348     *  @since JSOFA release 20160503
30349     *
30350     *  <!--Copyright (C) 2016 IAU SOFA Board.  See notes at end. -->
30351     */
30352     public static double[] jauLtpequ(double epj)
30353     {
30354         double veq[] = new double[3];
30355     /* Polynomial coefficients */
30356        final int NPOL = 4;
30357        final double xypol[][] = {
30358           {  5453.282155,
30359                 0.4252841,
30360                -0.00037173,
30361                -0.000000152},
30362           {-73750.930350,
30363                -0.7675452,
30364                -0.00018725,
30365                 0.000000231}
30366        };
30367 
30368     /* Periodic coefficients */
30369         final double xyper[][] = {
30370           { 256.75, -819.940624,75004.344875,81491.287984, 1558.515853},
30371           { 708.15,-8444.676815,  624.033993,  787.163481, 7774.939698},
30372           { 274.20, 2600.009459, 1251.136893, 1251.296102,-2219.534038},
30373           { 241.45, 2755.175630,-1102.212834,-1257.950837,-2523.969396},
30374           {2309.00, -167.659835,-2660.664980,-2966.799730,  247.850422},
30375           { 492.20,  871.855056,  699.291817,  639.744522, -846.485643},
30376           { 396.10,   44.769698,  153.167220,  131.600209,-1393.124055},
30377           { 288.90, -512.313065, -950.865637, -445.040117,  368.526116},
30378           { 231.10, -819.415595,  499.754645,  584.522874,  749.045012},
30379           {1610.00, -538.071099, -145.188210,  -89.756563,  444.704518},
30380           { 620.00, -189.793622,  558.116553,  524.429630,  235.934465},
30381           { 157.87, -402.922932,  -23.923029,  -13.549067,  374.049623},
30382           { 220.30,  179.516345, -165.405086, -210.157124, -171.330180},
30383           {1200.00,   -9.814756,    9.344131,  -44.919798,  -22.899655}
30384        };
30385        final int NPER = xyper.length;
30386 
30387     /* Miscellaneous */
30388        int i;
30389        double t, x, y, w, a, s, c;
30390 
30391 
30392     /* Centuries since J2000. */
30393        t  = ( epj - 2000.0 ) / 100.0;
30394 
30395     /* Initialize X and Y accumulators. */
30396        x = 0.0;
30397        y = 0.0;
30398 
30399     /* Periodic terms. */
30400        w = D2PI * t;
30401        for ( i = 0; i < NPER; i++ ) {
30402           a = w / xyper[i][0];
30403           s = sin(a);
30404           c = cos(a);
30405           x += c*xyper[i][1] + s*xyper[i][3];
30406           y += c*xyper[i][2] + s*xyper[i][4];
30407        }
30408 
30409     /* Polynomial terms. */
30410        w = 1.0;
30411        for ( i = 0; i < NPOL; i++ ) {
30412           x += xypol[0][i]*w;
30413           y += xypol[1][i]*w;
30414           w *= t;
30415        }
30416 
30417     /* X and Y (direction cosines). */
30418        x *= DAS2R;
30419        y *= DAS2R;
30420 
30421     /* Form the equator pole vector. */
30422        veq[0] = x;
30423        veq[1] = y;
30424        w = 1.0 - x*x - y*y;
30425        veq[2] = w < 0.0 ? 0.0 : sqrt(w);
30426 
30427        
30428        return veq;
30429 
30430     }
30431 
30432     /**
30433      * Position consisting of (ha, declination) pairs in radians. Where ha is hour angle and dec is declination .
30434      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 1 Feb 2010
30435      * 
30436      * @since JSOFA release 20180130
30437      */
30438     public static class EquatorialCoordinate {
30439         public double ha;
30440         public double dec;
30441         public EquatorialCoordinate(double ha, double dec){
30442             this.ha = ha;
30443             this.dec = dec;
30444         }
30445     }
30446 
30447     /**
30448      *
30449      *  Horizon to equatorial coordinates:  transform azimuth and altitude
30450      *  to hour angle and declination.
30451      *
30452      * <!-- Given: -->
30453      *  @param  az       double       azimuth
30454      *  @param  el       double       altitude (informally, elevation)
30455      *  @param  phi      double       site latitude
30456      *
30457      * <!-- Returned: -->
30458      *  @return   ha       double       hour angle (local)
30459      *     dec      double       declination
30460      *
30461      * <p>Notes: <ol>
30462      *
30463      * <li>  All the arguments are angles in radians.
30464      *
30465      * <li>  The sign convention for azimuth is north zero, east +pi/2.
30466      *
30467      * <li>  HA is returned in the range +/-pi.  Declination is returned in
30468      *      the range +/-pi/2.
30469      *
30470      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30471      *      rotation axis and the adopted zenith.  In many applications it
30472      *      will be sufficient to use the published geodetic latitude of the
30473      *      site.  In very precise (sub-arcsecond) applications, phi can be
30474      *      corrected for polar motion.
30475      *
30476      * <li>  The azimuth az must be with respect to the rotational north pole,
30477      *      as opposed to the ITRS pole, and an azimuth with respect to north
30478      *      on a map of the Earth's surface will need to be adjusted for
30479      *      polar motion if sub-arcsecond accuracy is required.
30480      *
30481      * <li>  Should the user wish to work with respect to the astronomical
30482      *      zenith rather than the geodetic zenith, phi will need to be
30483      *      adjusted for deflection of the vertical (often tens of
30484      *      arcseconds), and the zero point of ha will also be affected.
30485      *
30486      * <li>  The transformation is the same as Ve = Ry(phi-pi/2)*Rz(pi)*Vh,
30487      *      where Ve and Vh are lefthanded unit vectors in the (ha,dec) and
30488      *      (az,el) systems respectively and Rz and Ry are rotations about
30489      *      first the z-axis and then the y-axis.  (n.b. Rz(pi) simply
30490      *      reverses the signs of the x and y components.)  For efficiency,
30491      *      the algorithm is written out rather than calling other utility
30492      *      functions.  For applications that require even greater
30493      *      efficiency, additional savings are possible if constant terms
30494      *      such as functions of latitude are computed once and for all.
30495      *
30496      * <li>  Again for efficiency, no range checking of arguments is carried
30497      *      out.
30498      *</ol>
30499      *  Last revision:   2017 September 12
30500      *
30501      * @since JSOFA release 20180130
30502      *
30503      */
30504 
30505     public static  EquatorialCoordinate jauAe2hd (double az, double el, double phi)
30506     {
30507         double sa, ca, se, ce, sp, cp, x, y, z, r;
30508 
30509 
30510         /* Useful trig functions. */
30511         sa = sin(az);
30512         ca = cos(az);
30513         se = sin(el);
30514         ce = cos(el);
30515         sp = sin(phi);
30516         cp = cos(phi);
30517 
30518         /* HA,Dec unit vector. */
30519         x = - ca*ce*sp + se*cp;
30520         y = - sa*ce;
30521         z = ca*ce*cp + se*sp;
30522 
30523         /* To spherical. */
30524         r = sqrt(x*x + y*y);
30525         return new EquatorialCoordinate( (r != 0.0) ? atan2(y,x) : 0.0,
30526                 atan2(z,r));
30527 
30528         /* Finished. */
30529     }
30530 
30531 
30532     /**
30533      * Position consisting of (az, el) pairs in radians. Where az is the azimuth and el is elevation .
30534      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30535      * 
30536      * @since JSOFA release 20180130
30537      */
30538     public static class HorizonCoordinate {
30539         public double az;
30540         public double el;
30541         public HorizonCoordinate(double az, double el){
30542             this.az = az;
30543             this.el = el;
30544         }
30545     }
30546 
30547 
30548     /**
30549      *
30550      *  Equatorial to horizon coordinates:  transform hour angle and
30551      *  declination to azimuth and altitude.
30552      *
30553      *  <p>This function is derived from the International Astronomical Union's
30554      *  SOFA (Standards of Fundamental Astronomy) software collection.
30555      *
30556      *  <p>Status:  support function.
30557      *
30558      * <!-- Given: -->
30559      *  @param   ha       double       hour angle (local)
30560      *  @param   dec      double       declination
30561      *  @param   phi      double       site latitude
30562      *
30563      * <!-- Returned: -->
30564      *  @return   az      double       azimuth
30565      *     el      double       altitude (informally, elevation)
30566      *
30567      * <p>Notes: <ol>
30568      *
30569      * <li>  All the arguments are angles in radians.
30570      *
30571      * <li>  Azimuth is returned in the range 0-2pi;  north is zero, and east
30572      *      is +pi/2.  Altitude is returned in the range +/- pi/2.
30573      *
30574      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30575      *      rotation axis and the adopted zenith.  In many applications it
30576      *      will be sufficient to use the published geodetic latitude of the
30577      *      site.  In very precise (sub-arcsecond) applications, phi can be
30578      *      corrected for polar motion.
30579      *
30580      * <li>  The returned azimuth az is with respect to the rotational north
30581      *      pole, as opposed to the ITRS pole, and for sub-arcsecond
30582      *      accuracy will need to be adjusted for polar motion if it is to
30583      *      be with respect to north on a map of the Earth's surface.
30584      *
30585      * <li>  Should the user wish to work with respect to the astronomical
30586      *      zenith rather than the geodetic zenith, phi will need to be
30587      *      adjusted for deflection of the vertical (often tens of
30588      *      arcseconds), and the zero point of the hour angle ha will also
30589      *      be affected.
30590      *
30591      * <li>  The transformation is the same as Vh = Rz(pi)*Ry(pi/2-phi)*Ve,
30592      *      where Vh and Ve are lefthanded unit vectors in the (az,el) and
30593      *      (ha,dec) systems respectively and Ry and Rz are rotations about
30594      *      first the y-axis and then the z-axis.  (n.b. Rz(pi) simply
30595      *      reverses the signs of the x and y components.)  For efficiency,
30596      *      the algorithm is written out rather than calling other utility
30597      *      functions.  For applications that require even greater
30598      *      efficiency, additional savings are possible if constant terms
30599      *      such as functions of latitude are computed once and for all.
30600      *
30601      * <li>  Again for efficiency, no range checking of arguments is carried
30602      *      out.
30603      *</ol>
30604      *  Last revision:   2017 September 12
30605      *
30606      * @since JSOFA release 20180130
30607      *
30608      */
30609     public static HorizonCoordinate jauHd2ae (double ha, double dec, double phi)
30610     {
30611         double sh, ch, sd, cd, sp, cp, x, y, z, r, a;
30612 
30613 
30614         /* Useful trig functions. */
30615         sh = sin(ha);
30616         ch = cos(ha);
30617         sd = sin(dec);
30618         cd = cos(dec);
30619         sp = sin(phi);
30620         cp = cos(phi);
30621 
30622         /* Az,Alt unit vector. */
30623         x = - ch*cd*sp + sd*cp;
30624         y = - sh*cd;
30625         z = ch*cd*cp + sd*sp;
30626 
30627         /* To spherical. */
30628         r = sqrt(x*x + y*y);
30629         a = (r != 0.0) ? atan2(y,x) : 0.0;
30630         return new HorizonCoordinate((a < 0.0) ? a+D2PI : a,
30631                 atan2(z,r));
30632 
30633         /* Finished. */
30634     }
30635 
30636 
30637     /**
30638      *
30639      *  Parallactic angle for a given hour angle and declination.
30640      *
30641      *  <p>This function is derived from the International Astronomical Union's
30642      *  SOFA (Standards of Fundamental Astronomy) software collection.
30643      *
30644      *  <p>Status:  support function.
30645      *
30646      * <!-- Given: -->
30647      *  @param  ha     double     hour angle
30648      *  @param  dec    double     declination
30649      *  @param  phi    double     site latitude
30650      *
30651      *  Returned (function value):
30652      *            double     parallactic angle
30653      *
30654      * <p>Notes: <ol>
30655      *
30656      * <li>  All the arguments are angles in radians.
30657      *
30658      * <li>  The parallactic angle at a point in the sky is the position
30659      *      angle of the vertical, i.e. the angle between the directions to
30660      *      the north celestial pole and to the zenith respectively.
30661      *
30662      * <li>  The result is returned in the range -pi to +pi.
30663      *
30664      * <li>  At the pole itself a zero result is returned.
30665      *
30666      * <li>  The latitude phi is pi/2 minus the angle between the Earth's
30667      *      rotation axis and the adopted zenith.  In many applications it
30668      *      will be sufficient to use the published geodetic latitude of the
30669      *      site.  In very precise (sub-arcsecond) applications, phi can be
30670      *      corrected for polar motion.
30671      *
30672      * <li>  Should the user wish to work with respect to the astronomical
30673      *      zenith rather than the geodetic zenith, phi will need to be
30674      *      adjusted for deflection of the vertical (often tens of
30675      *      arcseconds), and the zero point of the hour angle ha will also
30676      *      be affected.
30677      *</ol>
30678      *  Reference:
30679      *     Smart, W.M., "Spherical Astronomy", Cambridge University Press,
30680      *     6th edition (Green, 1977), p49.
30681      *
30682      *  Last revision:   2017 September 12
30683      *
30684      * @since JSOFA release 20180130
30685      *
30686      */
30687     public static double jauHd2pa (double ha, double dec, double phi)
30688     {
30689         double cp, cqsz, sqsz;
30690 
30691 
30692         cp = cos(phi);
30693         sqsz = cp*sin(ha);
30694         cqsz = sin(phi)*cos(dec) - cp*sin(dec)*cos(ha);
30695         return ( ( sqsz != 0.0 || cqsz != 0.0 ) ? atan2(sqsz,cqsz) : 0.0 );
30696 
30697         /* Finished. */
30698     }
30699 
30700 
30701     /**
30702      * Tangent point soulutions. A class to contain tangent point soutions and an indication as to how many of the solutions are valid
30703      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30704      * @since JSOFA release 20180130
30705      */
30706     public static class TangentPointSolution
30707     {
30708         public SphericalCoordinate sol1;
30709         public SphericalCoordinate sol2;
30710 
30711         /** nsolutions. The number of useful solutions
30712          */
30713         public int nsolutions;
30714         /**
30715          * @param sol1
30716          * @param sol2
30717          * @param flag
30718          */
30719         public TangentPointSolution(SphericalCoordinate sol1,
30720                 SphericalCoordinate sol2, int flag) {
30721             this.sol1 = sol1;
30722             this.sol2 = sol2;
30723             this.nsolutions = flag;
30724         }
30725         public TangentPointSolution()
30726         {
30727             this.sol1 = null;
30728             this.sol2 = null;
30729             this.nsolutions = 0;
30730         }
30731     }
30732     /**
30733      *
30734      *  In the tangent plane projection, given the rectangular coordinates
30735      *  of a star and its spherical coordinates, determine the spherical
30736      *  coordinates of the tangent point.
30737      *
30738      *  <p>This function is derived from the International Astronomical Union's
30739      *  SOFA (Standards of Fundamental Astronomy) software collection.
30740      *
30741      *  <p>Status:  support function.
30742      *
30743      * <!-- Given: -->
30744      *   @param  xi     double  rectangular coordinates of star image (Note 2)
30745      *   @param  eta     double  rectangular coordinates of star image (Note 2)
30746      *   @param  a        double  star's spherical coordinates (Note 3)
30747      *   @param  b        double  star's spherical coordinates (Note 3)
30748      *
30749      * <!-- Returned: -->
30750      *     @return  tangent point's spherical coordinate solutions
30751      *
30752      *  Returned (function value):
30753      *                int     number of solutions:
30754      *                        0 = no solutions returned (Note 5)
30755      *                        1 = only the first solution is useful (Note 6)
30756      *                        2 = both solutions are useful (Note 6)
30757      *
30758      * <p>Notes: <ol>
30759      *
30760      * <li> The tangent plane projection is also called the "gnomonic
30761      *     projection" and the "central projection".
30762      *
30763      * <li> The eta axis points due north in the adopted coordinate system.
30764      *     If the spherical coordinates are observed (RA,Dec), the tangent
30765      *     plane coordinates (xi,eta) are conventionally called the
30766      *     "standard coordinates".  If the spherical coordinates are with
30767      *     respect to a right-handed triad, (xi,eta) are also right-handed.
30768      *     The units of (xi,eta) are, effectively, radians at the tangent
30769      *     point.
30770      *
30771      * <li> All angular arguments are in radians.
30772      *
30773      * <li> The angles a01 and a02 are returned in the range 0-2pi.  The
30774      *     angles b01 and b02 are returned in the range +/-pi, but in the
30775      *     usual, non-pole-crossing, case, the range is +/-pi/2.
30776      *
30777      * <li> Cases where there is no solution can arise only near the poles.
30778      *     For example, it is clearly impossible for a star at the pole
30779      *     itself to have a non-zero xi value, and hence it is meaningless
30780      *     to ask where the tangent point would have to be to bring about
30781      *     this combination of xi and dec.
30782      *
30783      * <li> Also near the poles, cases can arise where there are two useful
30784      *     solutions.  The return value indicates whether the second of the
30785      *     two solutions returned is useful;  1 indicates only one useful
30786      *     solution, the usual case.
30787      *
30788      * <li> The basis of the algorithm is to solve the spherical triangle PSC,
30789      *     where P is the north celestial pole, S is the star and C is the
30790      *     tangent point.  The spherical coordinates of the tangent point are
30791      *     [a0,b0];  writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), side c
30792      *     is then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
30793      *     found) is (pi/2-b0).  Angle C is given by sin(C) = xi/rho and
30794      *     cos(C) = eta/rho.  Angle P (to be found) is the longitude
30795      *     difference between star and tangent point (a-a0).
30796      *
30797      * <li> This function is a member of the following set:
30798      * <pre
30799      *{@code
30800      *         spherical      vector         solve for
30801      *
30802      *         iauTpxes      iauTpxev         xi,eta
30803      *         iauTpsts      iauTpstv          star
30804      *       > iauTpors <    iauTporv         origin
30805      *}
30806      *</ol>
30807      *  Called:
30808      *     iauAnp       normalize angle into range 0 to 2pi
30809      *
30810      *  References:
30811      *
30812      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
30813      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
30814      *
30815      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
30816      *     1987, Chapter 13.
30817      *
30818      * @version   2018 January 2
30819      *
30820      * @since JSOFA release 20180130
30821      *
30822      */
30823     public static TangentPointSolution jauTpors(double xi, double eta, double a, double b)
30824     {
30825         double xi2, r, sb, cb, rsb, rcb, w2, w, s, c;
30826         double a01, b01, a02, b02;
30827 
30828 
30829         xi2 = xi*xi;
30830         r = sqrt(1.0 + xi2 + eta*eta);
30831         sb = sin(b);
30832         cb = cos(b);
30833         rsb = r*sb;
30834         rcb = r*cb;
30835         w2 = rcb*rcb - xi2;
30836         if ( w2 >= 0.0 ) {
30837             w = sqrt(w2);
30838             s = rsb - eta*w;
30839             c = rsb*eta + w;
30840             if ( xi == 0.0 && w == 0.0 ) w = 1.0;
30841             a01 = jauAnp(a - atan2(xi,w));
30842             b01 = atan2(s,c);
30843             w = -w;
30844             s = rsb - eta*w;
30845             c = rsb*eta + w;
30846             a02 = jauAnp(a - atan2(xi,w));
30847             b02 = atan2(s,c);
30848             return new TangentPointSolution(new SphericalCoordinate(a01, b01), new SphericalCoordinate(a02, b02), 
30849                     (abs(rsb) < 1.0) ? 1 : 2);
30850         } else {
30851             return new TangentPointSolution();
30852         }
30853 
30854         /* Finished. */
30855 
30856     }
30857 
30858     /**
30859      * Tangent point soutions as direction cosines. A container class for two possible solutiuons as well as an indication of the number of valid solutions.
30860      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
30861      * @since 27 Mar 2018
30862      */
30863     public static class TangentPointDirectionCosines {
30864         public double dc1[];
30865         public double dc2[];
30866         /** nsolution. number of valid solutions.
30867          */
30868         public int nsolution;
30869         /**
30870          * @param dc1 direction cosines 
30871          * @param dc2 direction cosines
30872          * @param nsolution number of valid solutions
30873          */
30874         public TangentPointDirectionCosines(double[] dc1, double[] dc2,
30875                 int nsolution) {
30876             this.dc1 = dc1;
30877             this.dc2 = dc2;
30878             this.nsolution = nsolution;
30879         }
30880         /**
30881          * 
30882          */
30883         public TangentPointDirectionCosines() {
30884             this.nsolution = 0;
30885         }
30886 
30887     }
30888     /**
30889      *
30890      *  In the tangent plane projection, given the rectangular coordinates
30891      *  of a star and its direction cosines, determine the direction
30892      *  cosines of the tangent point.
30893      *
30894      *  <p>This function is derived from the International Astronomical Union's
30895      *  SOFA (Standards of Fundamental Astronomy) software collection.
30896      *
30897      *  <p>Status:  support function.
30898      *
30899      * <!-- Given: -->
30900      *     @param xi   double    rectangular coordinates of star image (Note 2)
30901      *     @param eta     double    rectangular coordinates of star image (Note 2)
30902      *     @param v        double[3] star's direction cosines (Note 3)
30903      *
30904      * <!-- Returned: -->
30905      *     @return       tangent point's direction cosines, Solutions 1 &amp; 2 
30906      *                   int     number of solutions:
30907      *                        0 = no solutions returned (Note 4)
30908      *                        1 = only the first solution is useful (Note 5)
30909      *                        2 = both solutions are useful (Note 5)
30910      *
30911      * <p>Notes: <ol>
30912      *
30913      * <li> The tangent plane projection is also called the "gnomonic
30914      *     projection" and the "central projection".
30915      *
30916      * <li> The eta axis points due north in the adopted coordinate system.
30917      *     If the direction cosines represent observed (RA,Dec), the tangent
30918      *     plane coordinates (xi,eta) are conventionally called the
30919      *     "standard coordinates".  If the direction cosines are with
30920      *     respect to a right-handed triad, (xi,eta) are also right-handed.
30921      *     The units of (xi,eta) are, effectively, radians at the tangent
30922      *     point.
30923      *
30924      * <li> The vector v must be of unit length or the result will be wrong.
30925      *
30926      * <li> Cases where there is no solution can arise only near the poles.
30927      *     For example, it is clearly impossible for a star at the pole
30928      *     itself to have a non-zero xi value, and hence it is meaningless
30929      *     to ask where the tangent point would have to be.
30930      *
30931      * <li> Also near the poles, cases can arise where there are two useful
30932      *     solutions.  The return value indicates whether the second of the
30933      *     two solutions returned is useful;  1 indicates only one useful
30934      *     solution, the usual case.
30935      *
30936      * <li> The basis of the algorithm is to solve the spherical triangle
30937      *     PSC, where P is the north celestial pole, S is the star and C is
30938      *     the tangent point.  Calling the celestial spherical coordinates
30939      *     of the star and tangent point (a,b) and (a0,b0) respectively, and
30940      *     writing rho^2 = (xi^2+eta^2) and r^2 = (1+rho^2), and
30941      *     transforming the vector v into (a,b) in the normal way, side c is
30942      *     then (pi/2-b), side p is sqrt(xi^2+eta^2) and side s (to be
30943      *     found) is (pi/2-b0), while angle C is given by sin(C) = xi/rho
30944      *     and cos(C) = eta/rho;  angle P (to be found) is (a-a0).  After
30945      *     solving the spherical triangle, the result (a0,b0) can be
30946      *     expressed in vector form as v0.
30947      *
30948      * <li> This function is a member of the following set:
30949      * {@code
30950      *         spherical      vector         solve for
30951      *
30952      *         iauTpxes      iauTpxev         xi,eta
30953      *         iauTpsts      iauTpstv          star
30954      *         iauTpors    > iauTporv <       origin
30955      * }
30956      *</ol>
30957      *  References:
30958      *
30959      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
30960      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
30961      *
30962      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
30963      *     1987, Chapter 13.
30964      *
30965      * @version   2018 January 2
30966      *
30967      * @since JSOFA release 20180130
30968      *
30969      */
30970 
30971     public static TangentPointDirectionCosines jauTporv(double xi, double eta, double v[])
30972     {
30973         double x, y, z, rxy2, xi2, eta2p1, r, rsb, rcb, w2, w, c;
30974         double v01[] = new double[3];
30975         double v02[] = new double[3];
30976 
30977         x = v[0];
30978         y = v[1];
30979         z = v[2];
30980         rxy2 = x*x + y*y;
30981         xi2 = xi*xi;
30982         eta2p1 = eta*eta + 1.0;
30983         r = sqrt(xi2 + eta2p1);
30984         rsb = r*z;
30985         rcb = r*sqrt(x*x + y*y);
30986         w2 = rcb*rcb - xi2;
30987         if ( w2 > 0.0 ) {
30988             w = sqrt(w2);
30989             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
30990             v01[0] = c * (x*w + y*xi);
30991             v01[1] = c * (y*w - x*xi);
30992             v01[2] = (rsb - eta*w) / eta2p1;
30993             w = - w;
30994             c = (rsb*eta + w) / (eta2p1*sqrt(rxy2*(w2+xi2)));
30995             v02[0] = c * (x*w + y*xi);
30996             v02[1] = c * (y*w - x*xi);
30997             v02[2] = (rsb - eta*w) / eta2p1;
30998             return new TangentPointDirectionCosines(v01,v02,(abs(rsb) < 1.0) ? 1 : 2);
30999         } else {
31000             return new TangentPointDirectionCosines();
31001         }
31002 
31003         /* Finished. */
31004     }
31005 
31006     /**
31007      *
31008      *  In the tangent plane projection, given the star's rectangular
31009      *  coordinates and the spherical coordinates of the tangent point,
31010      *  solve for the spherical coordinates of the star.
31011      *
31012      *  <p>This function is derived from the International Astronomical Union's
31013      *  SOFA (Standards of Fundamental Astronomy) software collection.
31014      *
31015      *  <p>Status:  support function.
31016      *
31017      * <!-- Given: -->
31018      *     @param xi    double  rectangular coordinates of star image (Note 2)
31019      *     @param eta    double  rectangular coordinates of star image (Note 2)
31020      *     @param a0     double  tangent point's spherical coordinates
31021      *     @param b0     double  tangent point's spherical coordinates
31022      *
31023      * <!-- Returned: -->
31024      *     @return     star's spherical coordinates
31025      *<ol>
31026      * <li> The tangent plane projection is also called the "gnomonic
31027      *     projection" and the "central projection".
31028      *
31029      * <li> The eta axis points due north in the adopted coordinate system.
31030      *     If the spherical coordinates are observed (RA,Dec), the tangent
31031      *     plane coordinates (xi,eta) are conventionally called the
31032      *     "standard coordinates".  If the spherical coordinates are with
31033      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31034      *     The units of (xi,eta) are, effectively, radians at the tangent
31035      *     point.
31036      *
31037      * <li> All angular arguments are in radians.
31038      *
31039      * <li> This function is a member of the following set:
31040      *{@code
31041      *         spherical      vector         solve for
31042      *
31043      *         iauTpxes      iauTpxev         xi,eta
31044      *       > iauTpsts <    iauTpstv          star
31045      *         iauTpors      iauTporv         origin
31046      * }
31047      *</ol>
31048      *  Called:
31049      *     iauAnp       normalize angle into range 0 to 2pi
31050      *
31051      *  References:
31052      *
31053      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31054      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31055      *
31056      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31057      *     1987, Chapter 13.
31058      *
31059      * @version   2018 January 2
31060      *
31061      * @since JSOFA release 20180130
31062      *
31063      */
31064     public static SphericalCoordinate jauTpsts(double xi, double eta, double a0, double b0)
31065     {
31066         double sb0, cb0, d;
31067 
31068         sb0 = sin(b0);
31069         cb0 = cos(b0);
31070         d = cb0 - eta*sb0;
31071         return new SphericalCoordinate( jauAnp(atan2(xi,d) + a0),
31072                 atan2(sb0+eta*cb0, sqrt(xi*xi+d*d)));
31073 
31074         /* Finished. */
31075     }
31076 
31077     /**
31078      * Tangent Plane Position consisting of (xi, eta) pairs in radians.
31079      * 
31080      * 
31081      * <p>Notes: <ol>
31082      *
31083      * <li> The tangent plane projection is also called the "gnomonic
31084      *     projection" and the "central projection".
31085      *
31086      * <li> The eta axis points due north in the adopted coordinate system.
31087      *     If the spherical coordinates are observed (RA,Dec), the tangent
31088      *     plane coordinates (xi,eta) are conventionally called the
31089      *     "standard coordinates".  For right-handed spherical coordinates,
31090      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31091      *     effectively, radians at the tangent point.
31092      *     </ol>
31093      * @author Paul Harrison (paul.harrison@manchester.ac.uk) 
31094      * 
31095      * @since JSOFA release 20180130
31096      */
31097     public static class TangentPlaneCoordinate {
31098         public double xi;
31099         public double eta;
31100         /** status.
31101          *                         0 = OK
31102          *                                1 = star too far from axis
31103          *                                2 = antistar on tangent plane
31104          *                                3 = antistar too far from axis
31105          */
31106         public int status;
31107         public TangentPlaneCoordinate(double xi, double eta, int j){
31108             this.xi = xi;
31109             this.eta = eta;
31110             this.status = j;
31111         }
31112     }
31113 
31114 
31115     /**
31116      *
31117      *  In the tangent plane projection, given the star's rectangular
31118      *  coordinates and the direction cosines of the tangent point, solve
31119      *  for the direction cosines of the star.
31120      *
31121      *  <p>This function is derived from the International Astronomical Union's
31122      *  SOFA (Standards of Fundamental Astronomy) software collection.
31123      *
31124      *  <p>Status:  support function.
31125      *
31126      * <!-- Given: -->
31127      *     @param xi  double     rectangular coordinates of star image (Note 2)
31128      *     @param eta  double     rectangular coordinates of star image (Note 2)
31129      *     @param v0      double[3]  tangent point's direction cosines
31130      *
31131      * <!-- Returned: -->
31132      *     @return      double[3]  star's direction cosines
31133      * <ol>
31134      * <li> The tangent plane projection is also called the "gnomonic
31135      *     projection" and the "central projection".
31136      *
31137      * <li> The eta axis points due north in the adopted coordinate system.
31138      *     If the direction cosines represent observed (RA,Dec), the tangent
31139      *     plane coordinates (xi,eta) are conventionally called the
31140      *     "standard coordinates".  If the direction cosines are with
31141      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31142      *     The units of (xi,eta) are, effectively, radians at the tangent
31143      *     point.
31144      *
31145      * <li> The method used is to complete the star vector in the (xi,eta)
31146      *     based triad and normalize it, then rotate the triad to put the
31147      *     tangent point at the pole with the x-axis aligned to zero
31148      *     longitude.  Writing (a0,b0) for the celestial spherical
31149      *     coordinates of the tangent point, the sequence of rotations is
31150      *     (b-pi/2) around the x-axis followed by (-a-pi/2) around the
31151      *     z-axis.
31152      *
31153      * <li> If vector v0 is not of unit length, the returned vector v will
31154      *     be wrong.
31155      *
31156      * <li> If vector v0 points at a pole, the returned vector v will be
31157      *     based on the arbitrary assumption that the longitude coordinate
31158      *     of the tangent point is zero.
31159      *
31160      * <li> This function is a member of the following set:
31161      *{@code
31162      *         spherical      vector         solve for
31163      *
31164      *         iauTpxes      iauTpxev         xi,eta
31165      *         iauTpsts    > iauTpstv <        star
31166      *         iauTpors      iauTporv         origin
31167      * }
31168      *</ol>
31169      *  References:
31170      *
31171      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31172      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31173      *
31174      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31175      *     1987, Chapter 13.
31176      *
31177      * @version   2018 January 2
31178      *
31179      * @since JSOFA release 20180130
31180      *
31181      */
31182     public static double[] jauTpstv(double xi, double eta, double v0[])
31183     {
31184         double x, y, z, f, r;
31185         double v[] = new double[3];
31186 
31187 
31188         /* Tangent point. */
31189         x = v0[0];
31190         y = v0[1];
31191         z = v0[2];
31192 
31193         /* Deal with polar case. */
31194         r = sqrt(x*x + y*y);
31195         if ( r == 0.0 ) {
31196             r = 1e-20;
31197             x = r;
31198         }
31199 
31200         /* Star vector length to tangent plane. */
31201         f = sqrt(1.0 + xi*xi + eta*eta);
31202 
31203         /* Apply the transformation and normalize. */
31204         v[0] = (x - (xi*y + eta*x*z) / r) / f;
31205         v[1] = (y + (xi*x - eta*y*z) / r) / f;
31206         v[2] = (z + eta*r) / f;
31207         return v;
31208 
31209         /* Finished. */
31210 
31211     }
31212 
31213     /**
31214      *
31215      *  In the tangent plane projection, given celestial spherical
31216      *  coordinates for a star and the tangent point, solve for the star's
31217      *  rectangular coordinates in the tangent plane.
31218      *
31219      *  <p>This function is derived from the International Astronomical Union's
31220      *  SOFA (Standards of Fundamental Astronomy) software collection.
31221      *
31222      *  <p>Status:  support function.
31223      *
31224      * <!-- Given: -->
31225      *     @param a       double  star's spherical coordinates
31226      *     @param b       double  star's spherical coordinates
31227      *     @param a0     double  tangent point's spherical coordinates
31228      *     @param b0     double  tangent point's spherical coordinates
31229      *
31230      * <!-- Returned: -->
31231      *     @return  rectangular coordinates of star image (Note 2)
31232       *               int     status:  0 = OK
31233      *                                1 = star too far from axis
31234      *                                2 = antistar on tangent plane
31235      *                                3 = antistar too far from axis
31236      *
31237      * <p>Notes: <ol>
31238      *
31239      * <li> The tangent plane projection is also called the "gnomonic
31240      *     projection" and the "central projection".
31241      *
31242      * <li> The eta axis points due north in the adopted coordinate system.
31243      *     If the spherical coordinates are observed (RA,Dec), the tangent
31244      *     plane coordinates (xi,eta) are conventionally called the
31245      *     "standard coordinates".  For right-handed spherical coordinates,
31246      *     (xi,eta) are also right-handed.  The units of (xi,eta) are,
31247      *     effectively, radians at the tangent point.
31248      *
31249      * <li> All angular arguments are in radians.
31250      *
31251      * <li> This function is a member of the following set:
31252      *{@code
31253      *         spherical      vector         solve for
31254      *
31255      *       > iauTpxes <    iauTpxev         xi,eta
31256      *         iauTpsts      iauTpstv          star
31257      *         iauTpors      iauTporv         origin
31258      *}
31259      *</ol>
31260      *  References:
31261      *
31262      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31263      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31264      *
31265      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31266      *     1987, Chapter 13.
31267      *
31268      * @version   2018 January 2
31269      *
31270      * @since JSOFA release 20180130
31271      *
31272      */
31273     public static TangentPlaneCoordinate jauTpxes(double a, double b, double a0, double b0)
31274     {
31275         int j;
31276         double sb0, sb, cb0, cb, da, sda, cda, d;
31277 
31278 
31279         /* Functions of the spherical coordinates. */
31280         sb0 = sin(b0);
31281         sb = sin(b);
31282         cb0 = cos(b0);
31283         cb = cos(b);
31284         da = a - a0;
31285         sda = sin(da);
31286         cda = cos(da);
31287 
31288         /* Reciprocal of star vector length to tangent plane. */
31289         d = sb*sb0 + cb*cb0*cda;
31290 
31291         /* Check for error cases. */
31292         if ( d > TANGENT_TINY ) {
31293             j = 0;
31294         } else if ( d >= 0.0 ) {
31295             j = 1;
31296             d = TANGENT_TINY;
31297         } else if ( d > -TANGENT_TINY ) {
31298             j = 2;
31299             d = -TANGENT_TINY;
31300         } else {
31301             j = 3;
31302         }
31303 
31304         /* Return the tangent plane coordinates (even in dubious cases). */
31305         return new TangentPlaneCoordinate( cb*sda / d,
31306                 (sb*cb0 - cb*sb0*cda) / d, j);
31307 
31308 
31309         /* Finished. */
31310     }
31311 
31312     /**
31313      *
31314      *  In the tangent plane projection, given celestial direction cosines
31315      *  for a star and the tangent point, solve for the star's rectangular
31316      *  coordinates in the tangent plane.
31317      *
31318      *  <p>This function is derived from the International Astronomical Union's
31319      *  SOFA (Standards of Fundamental Astronomy) software collection.
31320      *
31321      *  <p>Status:  support function.
31322      *
31323      * <!-- Given: -->
31324      *     @param v         double[3]  direction cosines of star (Note 4)
31325      *     @param v0        double[3]  direction cosines of tangent point (Note 4)
31326      *
31327      * <!-- Returned: -->
31328      *     @return     tangent plane coordinates of star
31329      *               int        status: 0 = OK
31330      *                                  1 = star too far from axis
31331      *                                  2 = antistar on tangent plane
31332      *                                  3 = antistar too far from axis
31333      *
31334      * <p>Notes: <ol>
31335      *
31336      * <li> The tangent plane projection is also called the "gnomonic
31337      *     projection" and the "central projection".
31338      *
31339      * <li> The eta axis points due north in the adopted coordinate system.
31340      *     If the direction cosines represent observed (RA,Dec), the tangent
31341      *     plane coordinates (xi,eta) are conventionally called the
31342      *     "standard coordinates".  If the direction cosines are with
31343      *     respect to a right-handed triad, (xi,eta) are also right-handed.
31344      *     The units of (xi,eta) are, effectively, radians at the tangent
31345      *     point.
31346      *
31347      * <li> The method used is to extend the star vector to the tangent
31348      *     plane and then rotate the triad so that (x,y) becomes (xi,eta).
31349      *     Writing (a,b) for the celestial spherical coordinates of the
31350      *     star, the sequence of rotations is (a+pi/2) around the z-axis
31351      *     followed by (pi/2-b) around the x-axis.
31352      *
31353      * <li> If vector v0 is not of unit length, or if vector v is of zero
31354      *     length, the results will be wrong.
31355      *
31356      * <li> If v0 points at a pole, the returned (xi,eta) will be based on
31357      *     the arbitrary assumption that the longitude coordinate of the
31358      *     tangent point is zero.
31359      *
31360      * <li> This function is a member of the following set:
31361      *{@code
31362      *         spherical      vector         solve for
31363      *
31364      *         iauTpxes    > iauTpxev <       xi,eta
31365      *         iauTpsts      iauTpstv          star
31366      *         iauTpors      iauTporv         origin
31367      * }
31368      *</ol>
31369      *  References:
31370      *
31371      *     Calabretta M.R. &amp; Greisen, E.W., 2002, "Representations of
31372      *     celestial coordinates in FITS", Astron.Astrophys. 395, 1077
31373      *
31374      *     Green, R.M., "Spherical Astronomy", Cambridge University Press,
31375      *     1987, Chapter 13.
31376      *
31377      * @version   2018 January 2
31378      *
31379      * @since JSOFA release 20180130
31380      *
31381      */
31382     public static TangentPlaneCoordinate jauTpxev(double v[], double v0[])
31383     {
31384         int j;
31385         double x, y, z, x0, y0, z0, r2, r, w, d;
31386 
31387 
31388         /* Star and tangent point. */
31389         x = v[0];
31390         y = v[1];
31391         z = v[2];
31392         x0 = v0[0];
31393         y0 = v0[1];
31394         z0 = v0[2];
31395 
31396         /* Deal with polar case. */
31397         r2 = x0*x0 + y0*y0;
31398         r = sqrt(r2);
31399         if ( r == 0.0 ) {
31400             r = 1e-20;
31401             x0 = r;
31402         }
31403 
31404         /* Reciprocal of star vector length to tangent plane. */
31405         w = x*x0 + y*y0;
31406         d = w + z*z0;
31407 
31408         /* Check for error cases. */
31409         if ( d > TANGENT_TINY ) {
31410             j = 0;
31411         } else if ( d >= 0.0 ) {
31412             j = 1;
31413             d = TANGENT_TINY;
31414         } else if ( d > -TANGENT_TINY ) {
31415             j = 2;
31416             d = -TANGENT_TINY;
31417         } else {
31418             j = 3;
31419         }
31420 
31421         /* Return the tangent plane coordinates (even in dubious cases). */
31422         d *= r;
31423         return new TangentPlaneCoordinate( (y*x0 - x*y0) / d,
31424                 (z*r2 - z0*w) / d, j);
31425 
31426 
31427         /* Finished. */
31428     }
31429 }
31430 
31431 /*
31432  * Copyright © 2018 Paul Harrison, University of Manchester.
31433  * 
31434  * This JSOFA software is derived from the official C release of the "Standards Of Fundamental Astronomy" (SOFA) library 
31435  * of the International Astronomical Union. The intention is to reproduce the functionality and algorithms of 
31436  * the official SOFA library in a pure Java form.
31437  * 
31438  * The responsibility for the maintenance and supply of the JSOFA library lies with the author (not the IAU SOFA Board), 
31439  * However, The JSOFA software is provided "as is" and the author makes no warranty as to its use or performance. 
31440  * The author does not and cannot warrant the performance or results which the user may obtain by using the JSOFA software. 
31441  * The author makes no warranties, express or implied, as to non-infringement of third party rights, merchantability,
31442  * or fitness for any particular purpose. In no event will the author be liable to the user for any consequential, 
31443  * incidental, or special damages, including any lost profits or lost savings, even if the author has been advised
31444  * of such damages, or for any claim by any third party.
31445  * 
31446  * Other conditions of the original license (reproduced below) are carried over as applicable.
31447  */
31448 
31449 /*----------------------------------------------------------------------
31450 *
31451 *  Copyright (C) 2018
31452 *  Standards Of Fundamental Astronomy Board
31453 *  of the International Astronomical Union.
31454 *
31455 *  =====================
31456 *  SOFA Software License
31457 *  =====================
31458 *
31459 *  NOTICE TO USER:
31460 *
31461 *  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
31462 *  CONDITIONS WHICH APPLY TO ITS USE.
31463 *
31464 *  1. The Software is owned by the IAU SOFA Board ("SOFA").
31465 *
31466 *  2. Permission is granted to anyone to use the SOFA software for any
31467 *     purpose, including commercial applications, free of charge and
31468 *     without payment of royalties, subject to the conditions and
31469 *     restrictions listed below.
31470 *
31471 *  3. You (the user) may copy and distribute SOFA source code to others,
31472 *     and use and adapt its code and algorithms in your own software,
31473 *     on a world-wide, royalty-free basis.  That portion of your
31474 *     distribution that does not consist of intact and unchanged copies
31475 *     of SOFA source code files is a "derived work" that must comply
31476 *     with the following requirements:
31477 *
31478 *     a) Your work shall be marked or carry a statement that it
31479 *        (i) uses routines and computations derived by you from
31480 *        software provided by SOFA under license to you; and
31481 *        (ii) does not itself constitute software provided by and/or
31482 *        endorsed by SOFA.
31483 *
31484 *     b) The source code of your derived work must contain descriptions
31485 *        of how the derived work is based upon, contains and/or differs
31486 *        from the original SOFA software.
31487 *
31488 *     c) The names of all routines in your derived work shall not
31489 *        include the prefix "iau" or "sofa" or trivial modifications
31490 *        thereof such as changes of case.
31491 *
31492 *     d) The origin of the SOFA components of your derived work must
31493 *        not be misrepresented;  you must not claim that you wrote the
31494 *        original software, nor file a patent application for SOFA
31495 *        software or algorithms embedded in the SOFA software.
31496 *
31497 *     e) These requirements must be reproduced intact in any source
31498 *        distribution and shall apply to anyone to whom you have
31499 *        granted a further right to modify the source code of your
31500 *        derived work.
31501 *
31502 *     Note that, as originally distributed, the SOFA software is
31503 *     intended to be a definitive implementation of the IAU standards,
31504 *     and consequently third-party modifications are discouraged.  All
31505 *     variations, no matter how minor, must be explicitly marked as
31506 *     such, as explained above.
31507 *
31508 *  4. You shall not cause the SOFA software to be brought into
31509 *     disrepute, either by misuse, or use for inappropriate tasks, or
31510 *     by inappropriate modification.
31511 *
31512 *  5. The SOFA software is provided "as is" and SOFA makes no warranty
31513 *     as to its use or performance.   SOFA does not and cannot warrant
31514 *     the performance or results which the user may obtain by using the
31515 *     SOFA software.  SOFA makes no warranties, express or implied, as
31516 *     to non-infringement of third party rights, merchantability, or
31517 *     fitness for any particular purpose.  In no event will SOFA be
31518 *     liable to the user for any consequential, incidental, or special
31519 *     damages, including any lost profits or lost savings, even if a
31520 *     SOFA representative has been advised of such damages, or for any
31521 *     claim by any third party.
31522 *
31523 *  6. The provision of any version of the SOFA software under the terms
31524 *     and conditions specified herein does not imply that future
31525 *     versions will also be made available under the same terms and
31526 *     conditions.
31527 *
31528 *  In any published work or commercial product which uses the SOFA
31529 *  software directly, acknowledgement (see www.iausofa.org) is
31530 *  appreciated.
31531 *
31532 *  Correspondence concerning SOFA software should be addressed as
31533 *  follows:
31534 *
31535 *      By email:  sofa@ukho.gov.uk
31536 *      By post:   IAU SOFA Center
31537 *                 HM Nautical Almanac Office
31538 *                 UK Hydrographic Office
31539 *                 Admiralty Way, Taunton
31540 *                 Somerset, TA1 2DN
31541 *                 United Kingdom
31542 *
31543 *--------------------------------------------------------------------*/
31544 
31545 
31546 /*
31547  * $Log$
31548  */